url-parse incorrectly parses hostname / protocol due to unstripped leading control characters.
- Severity:
- Medium
Description
Leading control characters in a URL are not stripped when passed into url-parse. This can cause input URLs to be mistakenly be interpreted as a relative URL without a hostname and protocol, while the WHATWG URL parser will trim control characters and treat it as an absolute URL.
Recommendation
Update the url-parse package to the latest compatible version. Followings are version details:
- Affected version(s): >= 0.1.0, < 1.5.9
- Patched version(s): 1.5.9
References
- GHSA-jf5r-8hm2-f872
- huntr.dev
- lists.debian.org
- security.netapp.com
- CVE-2022-0691
- CWE-639
- CAPEC-310
- OWASP 2021-A1
- OWASP 2021-A6
Related Issues
- url-parse Incorrectly parses URLs that include an '@ - CVE-2022-0639
- Authorization Bypass Through User-Controlled Key in url-parse - CVE-2022-0686
- Authorization bypass in url-parse - CVE-2022-0512
- Improper Validation and Sanitization in url-parse - CVE-2020-8124
- Tags:
- npm
- url-parse
Anything's wrong? Let us know Last updated on February 03, 2026