Executive brief
fast-uri is a library used to parse and validate URLs in Node.js applications. A flaw in how it handles international domain names (IDN) causes it to fail converting Unicode hostnames to their ASCII equivalents, leaving them in their original form. This creates a mismatch: when applications use fast-uri to enforce host-based security policies (like blocking loopback addresses or enforcing allow-lists), an attacker can bypass these checks by submitting URLs with visually similar Unicode characters that fast-uri accepts but that Node's URL parser converts to standard ASCII, leading to unintended destinations and policy bypass.
Technical details
The vulnerability is an interpretation conflict (CWE-436) in fast-uri's IDN canonicalization logic. When parsing HTTP URLs with Unicode/IDN hostnames, fast-uri attempts to call URL.domainToASCII() on the global WHATWG URL constructor; however, this method does not exist globally, resulting in a TypeError. The error is silently caught and stored in parsed.error, but the parse(), normalize(), and equal() functions return with the host left uncanonicalized in its original Unicode form. This causes a semantic desynchronization: fast-uri treats http://127。0。0。1/ (with fullwidth periods) as host "127。0。0。1", while Node's native WHATWG URL parser and fetch() canonicalize the same input to "127.0.0.1". Applications relying on fast-uri for host-based access control (denylists, loopback filtering, redirect validation, outbound proxy routing) before passing URLs to Node's URL or fetch() consumers are vulnerable to policy bypass. The vulnerability affects versions >=2.3.1 and <=4.0.0. Patches are available in v2.4.2, v3.1.3, and v4.0.1, which fix the issue by using WHATWG URL hostname parsing instead of the non-existent domainToASCII helper.
Affected products
- Fastify fast-uri >=2.3.1, <=4.0.0 (unfixed); 2.4.2, 3.1.3, 4.0.1 (patched)
Timeline
- 2026-06-29: disclosed
- 2026-07-21: advisory
- 2026-07-17: patched: v2.4.2, v3.1.3, v4.0.1 released
References
- https://github.com/fastify/fast-uri/security/advisories/GHSA-4c8g-83qw-93j6
- https://github.com/fastify/fast-uri/pull/188
- https://github.com/fastify/fast-uri/commit/2a6d357a18a68e6d812824379fd3388a1ae50d05
- https://github.com/fastify/fast-uri/commit/21ea1f9d70495c931f55dff893a8fa38f4f2e6bd
- https://github.com/fastify/fast-uri/commit/01db48010f594b98f7b323be18b393791c66ed1d
- https://access.redhat.com/errata/RHSA-2026:63371