Fastify Middleware Auth Bypass: Six Advisories (CVE-2026-133250 and Four More at CVSS 9.1) Let Requests Skip Auth in @fastify/express and @fastify/middie — Update to 4.0.10 and 9.3.8

Fastify's Express and Connect compatibility plugins can read a URL differently from Fastify's router, so crafted paths such as /tenant//admin or *admin reach protected handlers without running authentication middleware; fixes are in @fastify/express 4.0.10 and @fastify/middie 9.3.8.
The Fastify team has published a batch of critical advisories for the two plugins that let Fastify applications run Express- and Connect-style middleware: @fastify/express and @fastify/middie. All of them come down to the same weakness. The middleware layer and Fastify's router can read the same URL differently, so a request reaches a protected route handler while the authentication, authorization or rate-limiting middleware meant to guard it never runs.
Five of the six new advisories are rated critical (CVSS 9.1, network, no privileges, no user interaction). The fixes are @fastify/express 4.0.10 and @fastify/middie 9.3.8. Both were published on GitHub on 20 November 2026 and listed by the OpenJS Foundation CNA a day later.
What Happened
The project's lead maintainer published five @fastify/express advisories and one @fastify/middie advisory, each describing a different way to make the middleware matcher and the router disagree:
- CVE-2026-133250 (
@fastify/middie, CVSS 9.1): path-scoped middleware bypass through request path matching mismatches. Affects all releases before 9.3.8. - CVE-2026-133120 (
@fastify/express, CVSS 9.1): bypass through URL decoding and normalization mismatches, including double decoding of%25. - CVE-2026-129504 (
@fastify/express, CVSS 9.1): bypass through a mismatch when the plugin prefix and theuse()mount path are joined. - CVE-2026-124626 (
@fastify/express, CVSS 9.1): bypass through empty route parameters and wildcards. - CVE-2026-133867 (
@fastify/express, CVSS 9.1): bypass through RegExp mount paths under parameterized prefixes. - CVE-2026-129850 (
@fastify/express, CVSS 7.4): bypass through Unicode case folding, only when case-insensitive routing is turned on.
These are not the first of their kind. The same CNA listing shows three more @fastify/middie bypasses disclosed on 19 November (duplicate-slash mount paths, array mount-path type confusion and Unicode case folding), and an October middie advisory. In the same week, separate fixes landed across the wider ecosystem, including @fastify/swagger-ui (documentation authentication bypass through an unprotected /static route), @fastify/rate-limit (failed-login limit bypass through a race condition), @fastify/reply-from and @fastify/http-proxy.
Two of the @fastify/express reports carry a note on the advisory saying they were submitted with AI assistance. That fits the wider pattern of AI tools uncovering parser-mismatch bugs in bulk.
Technical Details
Fastify routes requests with its own router, find-my-way. The compatibility plugins pass each request through a separate matcher (Express's own or path-to-regexp) to decide which app.use() middleware applies. Whenever the two interpret a path differently, the handler runs and the middleware is skipped. The advisories describe several ways this happens:
- Empty parameters and wildcards. path-to-regexp requires at least one character for a dynamic segment, but find-my-way accepts an empty value. With auth mounted on
/tenant/:id/admin, a request to/tenant//adminis dispatched to the handler with an emptyid, and the middleware never matches./files/against/files/*pathbehaves the same way. Default configuration is enough. - Request targets starting with
*. find-my-way routes a target such as*adminto/admin, while the middleware matcher compares the raw string and finds no match. Per the express advisory this affects every release, static mounts included. - Double decoding. Since
@fastify/express4.0.3 the plugin percent-decodes the URL before Express parses it. Express then decodes again, so%2561licebecomesalicefor the middleware but%61licefor the handler. A backslash combined with whitespace or#makes Express rewrite\to/and miss parameterized, prefixed and RegExp mounts. In middie, a literal%in a mount path is decoded one extra time, so/100%25slips past a/100%mount. - Prefix join errors. The plugin prefix and the mount path are joined by string concatenation. A prefix ending in
/, or a mount path without a leading/, produces a mount that never lines up with the served route. No crafted request is needed: the middleware is simply never applied. - RegExp mounts under parameterized prefixes. For a prefix like
/tenant/:tenantId, a RegExp mount expects the literal text:tenantIdrather than a real value such asacme, so it silently never fires. - Unicode case folding. With
caseSensitive: false, find-my-way lowercases paths with JavaScript'stoLowerCase(), which turns U+212A KELVIN SIGN into an ASCIIk. Express does not, so/api/%E2%84%AAeysreaches the/api/keyshandler without its middleware. Only mount paths that contain akare affected.
The fixes make both plugins match middleware against the path the router actually dispatched. They also reject request targets that do not start with / (except the asterisk form), with a 400 in @fastify/express.
Who Is Affected
You are exposed if your Fastify application relies on @fastify/express or @fastify/middie to enforce security through path-scoped middleware: auth checks, tenant isolation, admin gates, IP allow-lists or rate limits mounted with app.use('/some/path', ...). This is common in projects migrated from Express that kept their old Passport, JWT or session middleware. Applications that enforce access control in Fastify hooks (onRequest, preHandler) on the route itself are not affected by this class of bug.
Affected ranges per the advisories:
@fastify/middie: all releases before 9.3.8.@fastify/express: before 4.0.10. Individual advisories start at 4.0.0, 4.0.5 or 4.0.7 depending on the vector, and the*-target issue affects all releases.
At the time of writing we found no reports of exploitation, and none of these CVEs is in CISA's Known Exploited Vulnerabilities catalog. The advisories, however, include working example request paths, so anyone can test for these bypasses.
What To Do Now
- Upgrade
@fastify/expressto 4.0.10 and@fastify/middieto 9.3.8 or later, then rebuild and redeploy. Check transitive copies too:
npm ls @fastify/express @fastify/middie
npm install @fastify/express@^4.0.10 @fastify/middie@^9.3.8
npm audit --omit=dev
- While you are in the lockfile, update
@fastify/swagger-ui,@fastify/rate-limit,@fastify/static,@fastify/reply-from,@fastify/http-proxy,@fastify/multipartand@fastify/busboy, which all received security fixes this month. - If you cannot upgrade right away, follow the maintainers' main workaround: move authorization into a Fastify
preHandlerhook, which runs after routing, and base the decision onrequest.routeOptions.url(the matched route pattern) rather thanrequest.url. The advisories say this covers every vector. - As a narrower stopgap for
@fastify/express, register anonRequesthook before the plugin that rejects request targets beginning with*or containing a backslash. - Remove configuration traps: give mount paths a leading slash, don't end plugin prefixes with
/, prefer string mounts over RegExp mounts under parameterized prefixes, and keep the default case-sensitive routing. - Add regression tests that send
/tenant//admin,*admin,%25-encoded and Kelvin-sign variants of your protected paths and assert a 401/403, not a 200. - Review access logs for request targets starting with
*, double slashes or%25sequences reaching protected endpoints.
Why It Matters
This is the same bug class seen in the Next.js middleware bypass of 2025 and in many reverse-proxy path confusion flaws: whenever two components each parse a URL, attackers look for the gap between them. Bolting Express-era middleware onto a framework with a different router builds that gap into the architecture, and patching one mismatch at a time is how this plugin family has ended up with more than ten bypass advisories in two months.
The durable fix is architectural, not a version bump. Enforce access control at the point where the routing decision has already been made, on the route itself, and treat path-prefix middleware as a convenience rather than a security boundary.
Sources
- @fastify/middie vulnerable to path-scoped middleware bypass via request path matching mismatches (GitHub Security Advisory)
- @fastify/express vulnerable to path-scoped middleware bypass via request URL decoding and normalization mismatches (GitHub Security Advisory)
- @fastify/express vulnerable to middleware bypass via empty route parameters and wildcards (GitHub Security Advisory)
- Security Advisories (OpenJS Foundation CNA)
