Executive brief
fast-uri is a Node.js library used to parse and normalize web addresses (URIs). The library decodes encoded hostnames twice during normalization, allowing attackers to bypass security checks designed to prevent server-side request forgery attacks. An attacker can craft a specially encoded URL that passes initial security validation but gets decoded into a malicious destination like an internal server or cloud metadata endpoint, potentially exposing sensitive data or allowing unauthorized access.
Technical details
fast-uri performs URI parsing and authority recomposition in a single operation, inadvertently decoding percent-escaped hostnames twice: once during initial parsing and again when reconstructing the authority component. This double-decoding flaw (CWE-174) combined with SSRF semantics (CWE-918) allows an attacker to craft nested percent-encoded URIs like `http://%256c%256f%2563%2561%256c%2568%256f%2573%2574/` that normalize to `http://localhost/`. The attack requires no authentication or user interaction and operates over the network. Applications performing security checks (SSRF validation, redirect allowlists, or host filtering) before calling normalize() or resolve() are vulnerable because the checked URI differs from the normalized destination. Patches are available in versions 2.4.5, 3.1.6, and 4.1.3; users can implement a temporary workaround by rejecting URIs containing encoded percent signs (%25) in the host component.
Affected products
- Fastify fast-uri 2.4.1–2.4.4, 3.1.2–3.1.5, 4.0.0–4.1.2
Timeline
- 2026-08-23: disclosed: Published to GitHub Advisory Database
- 2026-08-23: patched: Fixed in fast-uri 2.4.5, 3.1.6, and 4.1.3
- 2026-09-02: advisory: Updated in GitHub Advisory Database
References
- https://api.github.com/users/NotAFlightRisk
- https://github.com/NotAFlightRisk
- https://api.github.com/users/NotAFlightRisk/gists%7B/gist_id%7D
- https://api.github.com/users/NotAFlightRisk/repos
- https://avatars.githubusercontent.com/u/23277273?v=4
- https://api.github.com/users/NotAFlightRisk/events%7B/privacy%7D