CVE-2020-26291: Hostname spoofing via backslashes in URL in urijs
Summary
CVE-2020-26291: Hostname spoofing via backslashes in URL. Affects urijs versions < 1.19.4. Fixed in 1.19.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
urijs is an npm package that provides a JavaScript library for working with URLs. It allows developers to parse, manipulate, and generate URLs. The package is widely used in web development projects to handle URL-related operations. However, versions of urijs prior to 1.19.4 are vulnerable to a hostname spoofing vulnerability when processing URLs containing backslashes followed by an at character. This vulnerability can lead to incorrect security decisions and various potential attacks, such as allow/block list bypasses, SSRF attacks, open redirects, or other undesired behavior.
Vulnerability Detail
The vulnerability arises from the incorrect handling of backslashes followed by an at character in the hostname of a URL. Affected versions of urijs incorrectly return the observed hostname instead of the expected hostname. This can be exploited by an attacker to spoof the hostname and potentially bypass security measures. The impact of this vulnerability depends on how the hostname is used in security decisions. Patched versions of urijs (1.19.4 and later) correctly return the expected hostname, aligning with the behavior specified in the WHATWG URL specification.
How To Fix
Latest published version: 1.19.11 as of 23 Oct 2026
npm install urijs@1.19.11
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.19.4
This is the first release that contains the fix.
npm install urijs@1.19.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to update to the patched version (1.19.4) as soon as possible.
Conclusion
The hostname spoofing vulnerability in urijs versions prior to 1.19.4 can lead to incorrect security decisions and potential attacks. It is crucial to update to the patched version (1.19.4) to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for urijs →
FAQ
urijs is an npm package that provides a JavaScript library for working with URLs. It allows developers to parse, manipulate, and generate URLs.
The impact of this vulnerability depends on how the hostname is used in security decisions. It can potentially lead to allow/block list bypasses, SSRF attacks, open redirects, or other undesired behavior.
Versions of urijs prior to 1.19.4 are affected by this vulnerability.
To fix this vulnerability, update the urijs package to version 1.19.4 or later.
There is no known workaround for this vulnerability. It is recommended to update to the patched version (1.19.4) as soon as possible.
References
Related vulnerabilities
Recent vulnerabilities recorded for urijs.