Path Equivalencefast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Path Equivalence via the serialize() / normalize() functions, which incorrectly applied RFC 3986 remove_dot_segments to relative-path references. That algorithm is defined only for merged target paths, not for relative references themselves, so normalizing a relative path such as a/../b produced /b (root-relative), x/.. produced /, and ../x produced x. An attacker who can supply a relative URI reference can cause it to resolve to a different resource than intended after normalization, enabling path-traversal-style target substitution.
How to fix Path Equivalence? Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.
| <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3 |
Encoding Errorfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Encoding Error via the decodeValidScheme function, which decoded percent-encoded URI schemes using the deprecated unescape() global (including the JavaScript-only %uXXXX form) before validating them. An attacker can supply a percent-encoded scheme such as %6Aavascript:alert(1) or %u006Aavascript:alert(1), causing normalize() to return a live javascript: URI, resolve() to produce a javascript: URL, and equal() to treat the encoded form as equivalent to the decoded scheme. This enables scheme-confusion attacks, most notably cross-site scripting when the resulting URI is used in a browser navigation or href context.
How to fix Encoding Error? Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.
| <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3 |
Path Equivalencefast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Path Equivalence via the serialize(), normalize(), and resolve() functions when called with the non-default option reference: 'suffix' on a reference that has no authority. A bare colon in the first path segment of the emitted relative reference is not escaped, violating RFC 3986 section 3.3/4.2, which causes the output to reparse as an absolute URI with a scheme rather than a relative reference. An attacker who can influence the URI being serialized can exploit this to inject an unintended scheme into the output.
Note: This is only exploitable when the non-default reference: 'suffix' option is explicitly passed to serialize(), normalize(), or resolve().
How to fix Path Equivalence? Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.
| <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3 |
Improper Handling of Case Sensitivityfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Improper Handling of Case Sensitivity due to inconsistent normalization in the host component. An attacker can gain unauthorized access to restricted resources or services by submitting a specially crafted URI containing percent-encoded uppercase characters, which may bypass host allowlists or denylists in applications relying on case-sensitive host validation.
How to fix Improper Handling of Case Sensitivity? Upgrade fast-uri to version 2.4.7, 3.1.8, 4.1.5 or higher.
| <2.4.7>=3.0.0 <3.1.8>=4.0.0 <4.1.5 |
Improper Encoding or Escaping of Outputfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output that enables authority injection in the recomposeAuthority function, which escapes the userinfo and host components but concatenates the port field verbatim, so non-digit characters in the port introduce authority delimiters. An attacker can restructure the URI to redirect requests to a server they control by supplying a port value such as @127.0.0.1:8124, which demotes the legitimate host to userinfo and yields http://trusted.example:@127.0.0.1:8124/app. This requires the application to build URIs from separate components and assign untrusted data directly to the port field of an object passed to serialize(), normalize(), or equal(), and ports obtained via parse() are unaffected because parsing validates digit-only values.
How to fix Improper Encoding or Escaping of Output? Upgrade fast-uri to version 2.4.6, 3.1.7, 4.1.4 or higher.
| <2.4.6>=3.0.0 <3.1.7>=4.0.0 <4.1.4 |
Double Decoding of the Same Datafast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Double Decoding of the Same Data through hostname normalization in normalize() and resolve() and the authority recomposition logic in index.js and lib/utils.js. An attacker can redirect an application to an unintended host by supplying a URI whose hostname contains nested percent-encoded bytes, such as an encoded loopback or metadata address. The parser decodes the hostname once during normalization and then decodes it again when rebuilding the authority, so %25 sequences can turn into live host delimiters or dot characters during processing. Applications that normalize or resolve untrusted URIs before SSRF checks, redirect validation, or host allowlisting can be steered to internal destinations like localhost or a cloud metadata endpoint.
Workarounds
- Reject untrusted URIs whose host component contains an encoded percent sign (
%25) before passing them to normalize() or resolve(). This prevents nested percent-encoded hostnames from being decoded into live internal destinations such as loopback or metadata addresses.
How to fix Double Decoding of the Same Data? Upgrade fast-uri to version 2.4.5, 3.1.6, 4.1.3 or higher.
| >=2.4.1 <2.4.5>=3.1.2 <3.1.6>=4.0.0 <4.1.3 |
Improper Validation of Syntactic Correctness of Inputfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Improper Validation of Syntactic Correctness of Input through the normalizeIPv6() and parseWithStatus() host-processing paths in lib/utils.js and index.js. An attacker can route an application to a local or private address by supplying a malformed bracketed IPv6 literal such as http://[::not-valid]/private before the URL is normalized or checked. The parser accepts the malformed host without an error and silently rewrites it into a different valid IPv6 address, so downstream redirect handling, outbound requests, or host allowlist checks operate on the wrong destination. This can send traffic to loopback, unique-local, or link-local targets and expose internal services to unintended requests.
Workarounds
- Reject untrusted URLs whose host is a bracketed IPv6 literal before passing them to
fast-uri; this prevents malformed IPv6 text from being normalized into a different valid local or private address.
- Route outbound requests against an explicit allowlist of addresses instead of trusting the normalized host; this limits the impact if a malformed bracketed IPv6 literal is supplied.
How to fix Improper Validation of Syntactic Correctness of Input? Upgrade fast-uri to version 2.4.5, 3.1.6, 4.1.3 or higher.
| >=2.3.1 <2.4.5>=3.0.0 <3.1.6>=4.0.0 <4.1.3 |
Improper Handling of URL Encoding (Hex Encoding)fast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Improper Handling of URL Encoding (Hex Encoding) through the parseWithStatus, normalizeStringWithStatus, normalizeComparableURI, and resolve paths in index.js. An attacker can steer a URL normalizer or resolver to an attacker-chosen host by supplying a URI whose scheme decodes into reserved delimiter characters, such as %2f%2fevil.example:/pwn, causing normalize() or resolve() to emit a string that reparses with a different authority. This lets untrusted input bypass host-based redirect checks, allowlists, or outbound request decisions when applications trust the normalized result. A scheme containing encoded CRLF can also be serialized back as raw line breaks, which can corrupt a URI placed into a response header.
How to fix Improper Handling of URL Encoding (Hex Encoding)? Upgrade fast-uri to version 2.4.5, 3.1.6, 4.1.3 or higher.
| >=2.3.1 <2.4.5>=3.0.0 <3.1.6>=4.0.0 <4.1.3 |
Interpretation Conflictfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Interpretation Conflict due to malformed authority introducer handling in parseWithStatus() and resolve() in index.js. An attacker can bypass host-based URL checks and steer requests to an unintended host by supplying a URI that uses \\, /\\, or \\/ in place of // after the scheme. The parser folds those sequences into the path instead of recognizing an authority, while Node’s WHATWG URL treats them as a real authority on special schemes such as http, https, ws, wss, ftp, and file. Applications that validate a URL with fast-uri and then pass the same input to fetch(), undici, or Node’s HTTP clients can be sent to an attacker-controlled destination, enabling SSRF, redirect bypass, or outbound routing abuse.
How to fix Interpretation Conflict? Upgrade fast-uri to version 2.4.4, 3.1.5, 4.1.2 or higher.
| <2.4.4>=3.0.0 <3.1.5>=4.0.0 <4.1.2 |
Interpretation Conflictfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Interpretation Conflict via literal backslash handling in parseWithStatus in index.js. An attacker can bypass host-based validation by supplying a URI such as http://evil.com\@allowed.com, causing fast-uri to treat the input as an allowed host while Node’s WHATWG URL parser resolves it to a different destination. This breaks SSRF, redirect, and origin allowlist checks, letting requests be steered to unintended internal, loopback, or metadata endpoints.
Notes
- The mismatch matters anywhere the same URI string is parsed by
fast-uri for policy and then handed to Node consumers that use WHATWG parsing, including fetch(), undici, and Node http/https clients.
How to fix Interpretation Conflict? Upgrade fast-uri to version 2.4.3, 3.1.4, 4.1.1 or higher.
| >=2.3.1 <2.4.3>=3.0.0 <3.1.4>=4.0.0 <4.1.1 |
Interpretation Conflictfast-uri is a Dependency-free RFC 3986 URI toolbox
Affected versions of this package are vulnerable to Interpretation Conflict in its parse(), normalize(), and equal() functions, which call the nonexistent URL.domainToASCII() static method and silently swallow the resulting TypeError into parsed.error, leaving an internationalized hostname in its unconverted Unicode form. An attacker can steer host-based security policies to an unintended destination by supplying a URL with a Unicode or fullwidth hostname such as http://127。0。0。1/, which is parsed with the host left as 127。0。0。1 while Node's WHATWG URL parser and fetch() canonicalize it to 127.0.0.1. Exploitation requires the application to use this library for host-based decisions such as denylists, loopback filtering, or redirect and proxy validation before passing the URL to a downstream consumer that canonicalizes the host differently.
How to fix Interpretation Conflict? Upgrade fast-uri to version 2.4.2, 3.1.3, 4.0.1 or higher.
| >=2.3.1 <2.4.2>=3.0.0 <3.1.3>=4.0.0 <4.0.1 |