ZeroHour

CVE-2026-76169

large

Authentication Bypass in Fastify via Malformed URL Cross-Plugin Routing

CVSS 3.1
7.5 high
EPSS
<1%p43
Published
()
Modified
AI analysis

Fastify versions 4.0.0 up to but not including 5.12.2 contain a routing flaw in which the internal not-found router for encapsulated plugin handlers dispatches malformed URLs through a single shared handler pointer before URL decoding, ignoring the prefix. An unauthenticated attacker can send a malformed URL under one plugin's public prefix, causing the custom not-found handler of a different sibling plugin to be invoked without the preHandler hook declared for that handler. This lets the attacker reach an authentication-protected private fallback handler through an unrelated public prefix and read its full response, bypassing authentication with confidentiality impact only (no integrity or availability effect). Applications built on Fastify 4.0.0 through 5.12.1 that use encapsulated plugin prefixes with custom not-found handlers and preHandler-based authentication are affected. No public proof-of-concept or in-the-wild exploitation is known; the issue is not in CISA KEV and EPSS estimates only about a 0.5% probability of exploitation within 30 days.

What to do: Upgrade to fastify 5.12.2 or later. As an interim measure, avoid relying solely on preHandler hooks for authentication on custom not-found handlers and consider normalizing or rejecting malformed URLs at the edge (e.g., reverse proxy). Audit applications that register multiple sibling plugin prefixes with encapsulated not-found handlers for authentication-protected fallbacks reachable via malformed URLs.

Affected
Fastify (Node.js web framework)>= 4.0.0 and < 5.12.2 (fixed in 5.12.2 and later)
Estimated exposure
largetens of thousands of internet-facing Node.js services (Fastify draws millions of weekly npm downloads) — Estimated from Fastify's very large install base (millions of weekly npm downloads and public scans showing tens of thousands of Fastify-powered servers), narrowed to deployments that use sibling plugin prefixes with custom not-found…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

fastify versions >= 4.0.0 and before 5.12.2 can route a malformed URL sent under one plugin prefix to the custom not-found handler of a different sibling plugin, and invoke it without the preHandler hook declared for that handler. The internal not-found router for encapsulated handlers dispatches malformed paths through a single shared handler pointer before URL decoding, ignoring the prefix and skipping the selected handler's normal lifecycle. An unauthenticated attacker can therefore reach an authentication-protected private fallback through an unrelated public prefix and read its full response, bypassing the authentication hook and breaking prefix encapsulation. Users should upgrade to fastify 5.12.2 or later.

Vendors
fastify
Products
fastify
Weakness
CWE-288
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

In the news

No ingested article mentions this CVE yet.