Two Fastify plugins can silently skip your auth middleware
GitHub Security Advisories for @fastify/express and @fastify/middie describe critical path-matching bugs that let a request reach a route handler while the middleware guarding it never runs.
Fastify’s own GitHub Security Advisories, published on 20 November, detail critical bugs in two of its official plugins: @fastify/express and @fastify/middie. Both let path-scoped middleware, commonly used for authentication, authorisation or rate limiting, get silently skipped while the route handler behind it still runs.
The root cause is the same in both plugins: they decide whether to run middleware by matching the request path their own way, which can disagree with how Fastify’s router actually dispatches the request. For @fastify/express (CVE-2026-124626, CVSS 9.1, fixed in 4.0.10), a request with an empty dynamic segment, such as GET /tenant/, matches the Fastify route and runs the handler while middleware mounted on /tenant/:tenantId is skipped. For @fastify/middie (CVE-2026-133250, CVSS 9.1, fixed in 9.3.8), mismatched handling of empty parameters, wildcard-form targets and percent-encoded characters produces the same gap.
Why it matters: no special configuration triggers this, an unauthenticated request over the network is enough, and the impact is exactly the kind of check these plugins are usually there to enforce. If your app mounts Express or Connect-style middleware onto a Fastify server through either plugin, upgrade now.
The caveat: both advisories note that moving auth checks into Fastify hooks, rather than path-scoped middleware, avoids the class of bug entirely, since Fastify’s own router is what decides which hooks run.