CVE-2026-133867: @fastify/express regex middleware auth bypass under parameterized prefixes
@fastify/express 4.0.7 through 4.0.9 can silently skip regular-expression-mounted Express middleware when used inside a plugin registered under a parameterized prefix. This can bypass authentication/authorization middleware while Fastify still runs the route handler. Fixed in 4.0.10.
Summary
@fastify/express is a compatibility layer that lets Express middleware run inside Fastify. In versions 4.0.7 through 4.0.9, the plugin does not rewrite regular-expression mount paths to account for a parameterized plugin prefix. When middleware is mounted with a regular expression inside a plugin registered under a parameterized prefix, the Express matcher treats the prefix parameter as literal text and never matches the real request path.
As a result, Express silently skips that middleware while Fastify still runs the route handler. An application relying on regular-expression-mounted middleware for authentication or authorization inside a parameterized-prefix plugin can expose protected routes to unauthenticated clients. No special configuration is required beyond a parameterized prefix and a regular-expression mount.
The issue is fixed in @fastify/express 4.0.10. Users should upgrade to 4.0.10 or later.
References
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-133867 - OpenJS Foundation advisory reference: https://cna.openjsf.org/security-advisories.html - GitHub advisory: https://github.com/fastify/fastify-express/security/advisories/GHSA-84w6-xrf3-f8q8
What to do
1. Upgrade @fastify/express to 4.0.10 or later in all Node.js services using the plugin. 2. If you cannot upgrade immediately, audit applications for parameterized plugin prefixes combined with regular-expression middleware mounts, especially authentication or authorization middleware. 3. Review the vendor advisory and NVD entry to confirm exposure and any additional mitigations. If uncertain, verify the vendor advisory before changing production. 4. After patching, test protected routes with and without credentials to verify the middleware is enforced. 5. Monitor logs for unauthorized access attempts to routes that were previously protected by regex-mounted middleware.