CVE-2026-14198: @fastify/middie vulnerable to authorization bypass via encoded slash in path parameter values
@fastify/middie versions 9.1.0 through 9.3.2 decode the encoded slash %2F inside path parameter values before matching middleware paths, while Fastify's underlying router preserves the encoding during route lookup. The two layers disagree on the canonical request path, so the middleware fails to match a URL that the route handler does match. When middleware is used for authentication, authorization, rate limiting, or auditing on parameterized paths, an attacker can reach the protected handler by sending a single crafted URL with an encoded slash in the parameter position. The bypass is HTTP method agnostic and requires no authentication or special preconditions. Patches: upgrade to @fastify/middie 9.3.3. Workarounds: avoid parameterized middleware paths for security decisions, or enforce authentication at the route handler or via a Fastify hook that runs after the router has resolved the request.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
@fastify/middieto a version that resolves this vulnerability.Fixed in 9.3.3 - Configuration
Avoid using @fastify/middie middleware on parameterized paths when making authentication/authorization/rate limiting/auditing security decisions.
@fastify/middie (middleware path usage) parameterized middleware paths for security decisions = avoid - Compensating control
If you must use middleware for authorization/authentication, enforce those controls at the Fastify route handler or via a Fastify hook that runs after the router has resolved the request (so checks occur after route lookup rather than before middleware path matching).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-14198?
CVE-2026-14198 has a critical severity rating of 9.1.
How does CVE-2026-14198 affect @fastify/middie?
CVE-2026-14198 allows for an authorization bypass due to the inconsistent handling of encoded slashes in path parameter values.
Which versions of @fastify/middie are affected by CVE-2026-14198?
CVE-2026-14198 affects @fastify/middie versions 9.1.0 through 9.3.2.
How can I fix CVE-2026-14198?
To fix CVE-2026-14198, upgrade @fastify/middie to a version above 9.3.2 where the issue has been resolved.
What types of impact does CVE-2026-14198 have on an application?
CVE-2026-14198 can potentially lead to unauthorized access to resources due to bypassed authentication checks.