CVE-2026-129504 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.0 through 4.0.9, the plugin joins a path-scoped middleware's mount path to the Fastify plugin prefix by string concatenation, so when the plugin prefix ends with a slash or the mount path omits its leading slash, the resulting Express mount path does not line up with the route the Fastify router serves. Express then fails to match and passes the request on while the Fastify router still dispatches the route, so the middleware is silently skipped. An application that uses path-scoped Express middleware for authentication or authorization inside a prefixed plugin can expose protected routes to unauthenticated clients, with no crafted request and no non-default option required, and string, array, and regular-expression mount paths are all affected. 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/21/2026
The vulnerability identified in the @fastify/express compatibility layer represents a critical logic error within path resolution mechanisms that can lead to significant security bypasses for applications relying on Express middleware for access control. This plugin serves as an adapter allowing standard Express middleware functions to operate seamlessly within the Fastify web framework environment, bridging two distinct routing ecosystems with different conventions regarding URL path handling. In versions ranging from 4.0.0 through 4.0.9, the implementation of this bridge contains a fundamental flaw in how it constructs the mount paths for Express routes based on the configuration provided by the Fastify plugin system. The core technical issue stems from an improper string concatenation strategy used to combine the Fastify plugin prefix with the specific path scope defined within the Express middleware registration.
The operational mechanism of this vulnerability relies on a mismatch between how Fastify and Express interpret URL paths when slashes are omitted or duplicated during construction. Specifically, if the Fastify plugin prefix ends with a forward slash character, or if the mount path specified for the Express middleware omits its leading forward slash, the resulting concatenated string fails to align correctly with the route definitions handled by the underlying router systems. This misalignment causes a divergence in request handling behavior where the Express layer determines that no matching route exists for the incoming request and consequently passes it along without executing any associated middleware logic. Simultaneously, however, the Fastify router successfully matches the same request to its internal route handlers because it interprets the path differently due to its own normalization rules.
This discrepancy creates a dangerous state where protected routes remain accessible despite the presence of authentication or authorization middleware intended to guard them. Because the Express middleware is silently skipped by the framework's routing logic, any security checks implemented within that middleware are never executed for affected requests. This allows unauthenticated clients to access resources that should be restricted without requiring any specialized crafting of HTTP requests or manipulation of non-default configuration options. The vulnerability affects all types of path specifications used in mount paths, including simple strings, arrays of paths, and regular expressions, making it a pervasive issue across various application architectures that utilize this compatibility layer for implementing security controls such as session validation, role-based access control, or input sanitization.
From an industry standard perspective, this vulnerability aligns with CWE-284 Improper Access Control, specifically reflecting scenarios where authorization mechanisms are bypassed due to implementation errors in request routing logic. It also maps to MITRE ATT&CK techniques related to Privilege Escalation and Defense Evasion, as attackers can exploit the misconfigured middleware chain to gain unauthorized access to protected endpoints without triggering typical security alerts or logs associated with failed authentication attempts. The silent nature of this failure means that traditional monitoring tools may not detect these bypasses unless specific route-level logging is implemented independently of the middleware stack.
To mitigate this risk, organizations utilizing @fastify/express must immediately upgrade their dependencies to version 4.0.10 or later, where the path concatenation logic has been corrected to ensure consistent alignment between Fastify and Express routing tables. Developers should also audit existing applications for any reliance on implicit slash handling in plugin prefixes or middleware mount paths, ensuring that all path definitions are explicitly standardized with leading slashes to prevent similar issues if they were to occur in other parts of the application stack. Regular security assessments focusing on authentication flow integrity are recommended to verify that no protected routes remain exposed due to configuration oversights related to this compatibility layer.