CVE-2026-133867 in express
Summary
by MITRE • 11/21/2026
@fastify/express is a compatibility layer that lets Express middleware run inside the Fastify web framework. In versions 4.0.7 through 4.0.9, the plugin does not rewrite regular-expression mount paths to account for a parameterized plugin prefix, so when middleware is mounted with a regular expression inside a plugin registered under a parameterized prefix, the Express matcher treats the prefix parameter as literal text and never matches the real request path. As a result, Express silently skips that middleware while Fastify still runs the route handler, so an application that relies on regular-expression mounted middleware for authentication or authorization inside a parameterized-prefix plugin exposes protected routes to unauthenticated clients. No special configuration is required beyond a parameterized prefix and a regular-expression mount. The issue is fixed in @fastify/express 4.0.10, and users should upgrade to 4.0.10 or later.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/22/2026
The vulnerability identified in versions of the @fastify/express compatibility layer between 4.0.7 and 4.0.9 stems from a critical flaw in how regular expression mount paths are processed when used within plugins that have parameterized prefixes. This package serves as an interoperability bridge, allowing developers to utilize Express middleware within the Fastify web framework environment. The core technical failure occurs during the path matching phase where the plugin fails to correctly rewrite or interpret regular-expression based mount paths in the context of a dynamic prefix. Specifically, when middleware is mounted using a regular expression inside a plugin that has been registered under a parameterized route prefix, the underlying Express matcher incorrectly treats the variable portion of the prefix as literal text rather than resolving it against incoming request paths. This misalignment means that the regex pattern never successfully matches the actual URL structure sent by clients because the dynamic segment is not being substituted or accounted for in the matching logic.
From an operational security perspective, this defect leads to a severe authorization bypass scenario. Applications frequently rely on Express middleware mounted at specific path patterns to enforce authentication checks, role-based access control, or other security policies before allowing requests to reach their final handlers. Because of this bug, when such middleware is placed inside a plugin with a parameterized prefix and uses regular expression mounting for flexibility, the middleware is silently skipped by the Fastify runtime while the associated route handler still executes. Consequently, any request directed at these protected endpoints bypasses the intended security controls entirely. This results in unauthenticated or unauthorized users gaining access to sensitive resources that should have been restricted, effectively nullifying the protective measures implemented via the Express middleware layer.
This issue aligns with CWE-284 Improper Access Control and represents a classic case of logic errors leading to privilege escalation within web application frameworks. In terms of attack vectors, it relates to ATT&CK techniques involving unauthorized access through misconfigured security controls or bypassing authentication mechanisms due to implementation flaws. The vulnerability does not require complex exploitation steps; any client sending requests that match the affected route patterns will automatically bypass the middleware checks if they fall under a parameterized prefix with regex mounting. This makes the impact immediate and widespread for applications relying on this specific configuration pattern without additional manual validation layers.
To mitigate this risk, organizations utilizing @fastify/express must upgrade to version 4.0.10 or later where the path rewriting logic has been corrected to properly handle parameterized prefixes with regular expression mounts. Until an upgrade is performed, developers should consider refactoring their route structures to avoid combining parameterized plugin prefixes with regular-expression mounted middleware within that context. Alternatively, implementing redundant authentication checks directly in Fastify handlers can provide a temporary safeguard against unauthorized access until the underlying library issue is resolved through patching.