Packages / fast-uri / Security
fast-uri vulnerable to server-side request forgery via repeated hostname percent-decoding
Affected releases · fast-uri
- 4.x4.0.0 – 4.1.2Fixed in 4.1.3
- 3.x3.1.2 – 3.1.5Fixed in 3.1.6
- 2.x2.4.1 – 2.4.4Fixed in 2.4.5
On 4.x, the newest line:
npm install fast-uri@4.1.3Every release on a timeline
Affected
4.0.0 – 4.1.2
5 releases
Fixed
4.1.3 – 4.2.3
7 releases, latest
Not affected
3.0.0 – 3.1.1
9 releases
Affected
3.1.2 – 3.1.5
4 releases
Fixed
3.1.6 – 3.1.9
4 releases
Not affected
2.0.0 – 2.4.0
6 releases
Affected
2.4.1 – 2.4.4
4 releases
Fixed
2.4.5 – 2.4.8
4 releases
What happens
Impact
fast-uri decodes a hostname's percent escapes twice in a single normalize() or resolve() call: once during parsing and again during authority recomposition. A nested percent-encoded host therefore survives the first decode and is turned into a live destination by the second, so normalize('http://%256c%256f%2563%2561%256c%2568%256f%2573%2574/') returns http://localhost/. Applications that normalize or resolve an untrusted URI before an SSRF check, redirect validation, or host allowlist can be steered to a different destination, including internal addresses such as loopback or a cloud metadata endpoint, than the encoded input appeared to contain. This is an incomplete-fix variant of CVE-2026-6322, whose encoded-authority-delimiter fix introduced the second decode.
Patches
Fixed in fast-uri 2.4.5, 3.1.6, and 4.1.3.
Workarounds
Reject untrusted URIs whose host component contains an encoded percent sign (%25) before passing them to normalize() or resolve().
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.