CVE-2026-133250: @fastify/middie path-based middleware bypass can expose protected handlers
In @fastify/middie <=9.3.7, path-scoped middleware can be skipped because middie evaluates a different path than Fastify's router, allowing unauthenticated requests to reach handlers meant to be protected by middleware. Fixed in 9.3.8.
Overview
CVE-2026-133250 affects @fastify/middie, the middleware engine for Fastify. Versions up to and including 9.3.7 match path-scoped middleware against middie's own reading of the request path, which can differ from the path used by Fastify's router to dispatch the request. If the two disagree, a request can be routed to a handler covered by a middleware mount while middie skips that middleware. This can bypass authentication, authorization, or rate-limiting middleware without any special configuration.
Trigger conditions The mismatch is triggered by: - Empty parameter or wildcard values - Request targets that do not begin with a slash - Literal percent characters in a mount path
Fix Fixed in @fastify/middie 9.3.8 or later.
What to do 1. Review the NVD entry and Fastify security advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-133250 and https://github.com/fastify/middie/security/advisories/GHSA-gcf6-j9m3-p97x 2. Upgrade @fastify/middie to 9.3.8 or later in all Fastify applications that use path-scoped middleware. 3. Verify the vendor advisory before deploying to production if you are unsure whether your middleware mounts are affected. 4. After upgrading, audit exposures for routes protected only by path-scoped middleware, especially where auth, authorization, or rate limiting is applied. 5. If upgrade is not immediately possible, review request path handling and add compensating controls around any protected handler until 9.3.8 is deployed.
Sources: NVD, OpenJS Foundation, GitHub advisory.