Executive brief
@fastify/express is a popular middleware adapter that brings Express-style middleware support to Fastify applications. The vulnerability allows attackers to bypass middleware security protections (such as authentication checks) by using URL-encoded path characters. An attacker can access restricted endpoints like /admin by requesting encoded variations like /%61dmin, bypassing the middleware entirely while still reaching the intended route handler.
Technical details
The vulnerability is a middleware bypass caused by inconsistent URL path handling between the @fastify/express middleware matching engine and the underlying Fastify router. When a request arrives with a URL-encoded path (e.g., /%61dmin for /admin), the middleware engine fails to match the encoded path against registered middleware prefixes and skips execution. However, the Fastify router downstream correctly decodes the URL and matches the route handler, allowing the request to reach protected endpoints without passing through blocking middleware. The attack requires low privileges and works over the network with moderate attack complexity. Patches are available in version 4.0.3 and later.
Affected products
- Fastify @fastify/express <= 4.0.2
Timeline
- 2026-01-19: disclosed: NVD publication date
- 2026-01-20: disclosed: GitHub advisory GHSA-g6q3-96cp-5r5m published
- 2026-01-20: patched: Version 4.0.3 released with fix