Packages / fast-uri / Security
fast-uri vulnerable to host confusion via literal backslash authority delimiter
Affected releases · fast-uri
- 4.x4.0.0 – 4.1.0Fixed in 4.1.1
- 3.x3.0.0 – 3.1.3Fixed in 3.1.4
- 2.x2.3.1 – 2.4.2Fixed in 2.4.3
On 4.x, the newest line:
npm install fast-uri@4.1.1Every release on a timeline
Affected
4.0.0 – 4.1.0
3 releases
Fixed
4.1.1 – 4.2.3
9 releases, latest
Affected
3.0.0 – 3.1.3
11 releases
Fixed
3.1.4 – 3.1.9
6 releases
Not affected
2.0.0 – 2.3.0
4 releases
Affected
2.3.1 – 2.4.2
4 releases
Fixed
2.4.3 – 2.4.8
6 releases
What happens
Impact
fast-uri v4.1.0 and earlier do not treat a literal backslash (U+005C) as an authority delimiter. Node's native WHATWG URL (used by fetch(), undici, and Node's http/https clients) normalizes \ to / for special schemes (http, https, ws, wss, ftp, file), so the two parsers extract different hosts from the same input string.
For example, http://evil.com\@allowed.com is treated by fast-uri as host allowed.com with userinfo evil.com\, while Node's WHATWG URL parser and fetch() see host evil.com with path /@allowed.com.
Applications that use fast-uri to enforce host-based policy (allowlists, denylists, loopback/SSRF filtering, redirect validation, outbound proxy routing) before passing the same URL into Node's URL or fetch() consumers see a policy/use desync and can be steered to an unintended destination, including cloud metadata endpoints, loopback, or internal hosts.
Patches
Upgrade to fast-uri v4.1.1, v3.1.4, or v2.4.3.
Workarounds
None. Upgrade to the patched version.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.