CVE-2021-27516: Hostname spoofing via backslashes in URL in urijs

urijs Updated 02 Oct 2025

Summary

01/03/2021
Yes i
High
7.5

CVE-2021-27516: URIjs Hostname spoofing via backslashes in URL. Affects urijs versions < 1.19.6. Fixed in 1.19.6. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

urijs is an npm package that provides a JavaScript library for working with URLs. It allows developers to parse, manipulate, and generate URLs in a convenient and reliable manner. The package is widely used in web development projects to handle URL-related operations. However, versions of urijs prior to 1.19.6 are vulnerable to a hostname spoofing issue when processing URLs containing backslashes in the scheme delimiter. This vulnerability can lead to incorrect hostname determination, potentially resulting in security bypasses, SSRF attacks, open redirects, or other undesired behavior.

Vulnerability Detail

The vulnerability arises from the incorrect handling of backslashes in the scheme delimiter of URLs. By using a backslash character as part of the scheme delimiter, an attacker can spoof the hostname in the URL. This can have various impacts depending on how the hostname is used in security decisions. For example, it can bypass allow/block lists, enable SSRF attacks, or facilitate open redirects. The affected versions of urijs incorrectly return no hostname when processing such URLs, while the patched version (1.19.6) correctly returns the expected hostname. It is important to note that the patched version aligns with the behavior of other parsers implementing the WHATWG URL specification, including web browsers and Node's built-in URL class.

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.6

This is the first release that contains the fix.

npm install urijs@1.19.6

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 upgrade to the patched version as soon as possible.

Conclusion

The hostname spoofing vulnerability in urijs can have significant security implications, including allow/block list bypasses, SSRF attacks, and open redirects. It is crucial for developers to upgrade to the patched version (1.19.6) to ensure correct hostname determination in URLs. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for urijs →

Share this vulnerability

FAQ

urijs is an npm package that provides a JavaScript library for working with URLs. It allows developers to parse, manipulate, and generate URLs in a convenient and reliable manner.

The impact of this vulnerability can vary depending on how the hostname is used in security decisions. Possible impacts include allow/block list bypasses, SSRF attacks, open redirects, or other undesired behavior.

To fix this vulnerability, you should upgrade the urijs package to version 1.19.6 or later. This patched version correctly handles URLs with backslashes in the scheme delimiter.

There is no known workaround for this vulnerability. It is recommended to upgrade to the patched version (1.19.6) as soon as possible.

For more information, you can refer to the advisory on the GitHub repository of urijs: https://github.com/medialize/URI.js

Related vulnerabilities

Recent vulnerabilities recorded for urijs.

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.6

This is the first release that contains the fix.

npm install urijs@1.19.6

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback