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


0.0
medium

Snyk CVSS

    Attack Complexity Low
    User Interaction Required
    Confidentiality High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.17% (54th percentile)
Expand this section
NVD
7.5 high

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