Middleware bypass in @fastify/middie via prefixed plugin route paths
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-863.
Summary
@fastify/middie from 9.3.6 before 9.3.10 handles route or mount paths without a leading slash inside prefixed plugins inconsistently (CWE-436). Middleware is mounted with a slash after the prefix, but the route joins the prefix directly, so a request to that path skips the middleware. A remote attacker can bypass authentication or other middleware-based access controls on the affected routes.
Written with Claude Haiku 5.5 from the sources below · 2026-11-26
Description from the CNA
@fastify/middie is the plugin that adds Express-style middleware support to the Fastify web framework. In versions 9.3.6 through 9.3.9, a route or mount path written without a leading slash inside a plugin registered under a prefix is handled inconsistently: the middleware is mounted with a separating slash after the prefix, while the route is concatenated directly onto the prefix, so a request to the concatenated path reaches the route handler without running the middleware mounted for it. An attacker can use this to bypass authentication or other middleware-based access controls on the affected routes. The issue is fixed in @fastify/middie 9.3.10, and users should upgrade to 9.3.10 or later. As a workaround, begin all route and mount paths with a slash, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Upgrade @fastify/middie to 9.3.10 or later, which fixes the issue. As a workaround, begin all route and mount paths with a slash, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.
Written with Claude Haiku 5.5 from the sources below · 2026-11-26
- Fix · CNA @fastify/middie (@fastify/middie) Fixed in 9.3.10
Timeline
- 2026-11-26 Threatist record created from CVE-2026-135205
References
More fastify vulnerabilities
- TI-2026-26180 @fastify/express vulnerable to middleware authentication bypass via URL normalization… CVSS 4.0CRITICAL 9.1
- TI-2026-26179 @fastify/express vulnerable to middleware path doubling causing authentication bypass in child plugin scopes CVSS 3.1CRITICAL 9.1
- TI-2026-26177 @fastify/reply-from vulnerable to connection header abuse enabling stripping of proxy-added headers CVSS 4.0CRITICAL 9.0
- TI-2026-05498 @fastify/middie vulnerable to middleware authentication bypass in child plugin scopes CVSS 3.1CRITICAL 9.1
- TI-2023-15307 Cross-site request forgery in npm @fastify/oauth2 CVSS 3.1HIGH 8.8
- TI-2026-17731 @fastify/express vulnerable to Improper Handling of URL Encoding (Hex Encoding) CVSS 3.1HIGH 8.4
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences