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): < 1.5.9
- Patched version(s): 1.5.9
References
- GHSA-jf5r-8hm2-f872
- huntr.dev
- security.netapp.com
- lists.debian.org
- CVE-2022-0691
- CWE-639
- CAPEC-310
- OWASP 2021-A1
- OWASP 2021-A6
Related Issues
- angular vulnerable to regular expression denial of service via the <input type="url"> element - CVE-2023-26118
- Vega vulnerable to Cross-site Scripting via RegExp.prototype[@@replace] (GHSA-963h-3v39-3pqf) - CVE-2025-27793
- @hono/node-server has Denial of Service risk when receiving Host header that cannot be parsed - CVE-2024-32652
- jose vulnerable to resource exhaustion via specifically crafted JWE with compressed plaintext - CVE-2024-28176
- Tags:
- npm
- url-parse
Anything's wrong? Let us know Last updated on September 11, 2023