Skip to content
SSRF Disclosed report Intermediate CVE-2018-3774

url-parse package return wrong hostname

The url-parse package returned an incorrect hostname for certain URLs, which could lead to vulnerabilities such as SSRF, open redirect, and authentication bypass. An attacker could craft a URL that the library parses with a different hostname than the actual destination, potentially bypassing security controls.

leetboi Follow

Originally disclosed on HackerOne

High 7.5 View original
  • Triaged in 6 days
  • Fixed in 11 days
  • Disclosed after 11 days

Summary by the program

Jul 19th 2018 - lolwaleet submitted a report to Node.js third-party modules. I would like to report url-parse package return wrong hostname in url-parse.

Module

module name: url-parse version: 1.4.1 npm page: https://www.npmjs.com/package/url-parse

Module Description

The url-parse method exposes two different API interfaces. The url interface that you know from Node.js and the new URL interface that is available in the latest browsers.

In version 0.1 we moved from a DOM based parsing solution, using the <a> element, to a full Regular Expression solution. The main reason for this was to make the URL parser available in different JavaScript environments as you don't always have access to the DOM. An example of such environment is the Worker interface. The RegExp based solution didn't work well as it required a lot of lookups causing major problems in FireFox. In version 1.0.0 we ditched the RegExp based solution in favor of a pure string parsing solution which chops up the URL into smaller pieces. This module still has a really small footprint as it has been designed to be used on the client side.

Vulnerability

Vulnerability Description

url-parse returns wrong hostname which leads to multiple vulnerabilities such as SSRF, Open Redirect, Bypass Authentication Protocol.

Fix

Fixes applied to version 1.4.3

Resources:

The original report as published on HackerOne, by leetboi. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a flaw in the string parsing logic that incorrectly extracts the hostname from certain URL formats.

Impact

This could enable SSRF, open redirect, and authentication bypass, though the report does not provide specific exploitation details.

What the attacker needed

Use of vulnerable url-parse version

The fix

The issue was fixed in version 1.4.3 with a patch that includes regression tests.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A library that splits web addresses into parts (like the domain name) sometimes got the domain wrong. If a program trusts that wrong domain, an attacker could trick it into sending requests to unintended places or redirecting users to malicious sites.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

More by leetboi

View all

1 more disclosed report, best first.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.