Authorization Bypass Affecting url-parse package, versions <1.5.8
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.22% (61st
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-URLPARSE-2407759
- published 21 Feb 2022
- disclosed 21 Feb 2022
- credit Rohan Sharma
Introduced: 21 Feb 2022
CVE-2022-0686 Open this link in a new tabHow to fix?
Upgrade url-parse
to version 1.5.8 or higher.
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Authorization Bypass via the hostname
field of a parsed URL, because "url-parse" is unable to find the correct hostname when no port number is provided in the URL.
PoC:
var Url = require('url-parse');
var PAYLOAD = "http://example.com:";
console.log(Url(PAYLOAD));
// Expected hostname: example.com
// Actual hostname by url-parse: example.com:
Output:
{
slashes: true,
protocol: 'http:',
hash: '',
query: '',
pathname: '/',
auth: '',
host: 'example.com:',
port: '',
hostname: 'example.com:',
password: '',
username: '',
origin: 'http://example.com:',
href: 'http://example.com:/'
}
References
CVSS Scores
version 3.1