CVE-2026-135264 in expressinfo

Summary

by MITRE • 11/26/2026

@fastify/express is the plugin that lets an application run Express middleware and Express applications inside the Fastify web framework. In versions from 4.0.7 before 4.0.14, when middleware is mounted on a nested array of mount paths the plugin rewrites only the top level of the array, so paths inside a nested array are not adjusted for a plugin registered under a prefix and the middleware never runs for them, a nested regular-expression mount keeps its global or sticky flag and is matched statefully so it is skipped on alternating requests, a nested regular expression is not matched case-insensitively when case sensitivity is disabled, and nested dynamic paths are not covered by the earlier empty-segment check. An attacker can use any of these to bypass authentication or other middleware-based access controls on the affected routes. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, flatten mount path arrays before passing them to the plugin, or enforce authentication in a Fastify hook such as preHandler that runs after the router resolves the request.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/26/2026

The @fastify/express plugin serves as a critical bridge allowing developers to integrate existing Express middleware and applications within the Fastify web framework ecosystem. This integration is particularly valuable for legacy code migration or leveraging specific Express-based libraries, but it introduces complexity in how routing paths are processed and matched against incoming requests. In versions ranging from 4.0.7 up to, but not including, 4.0.14, a significant architectural flaw exists in the path resolution logic when handling nested arrays of mount paths or complex regular expression patterns. This vulnerability stems from an incomplete implementation of prefix rewriting and state management within the plugin's internal routing mechanism, leading to inconsistent behavior that can be exploited by malicious actors to bypass security controls.

The core technical deficiency lies in how the plugin handles array-based route definitions when a Fastify instance is registered under a specific prefix. When middleware is mounted using an array of paths, particularly those containing nested arrays or regular expressions, the plugin fails to correctly rewrite all levels of path nesting relative to the parent prefix. Specifically, only the top-level elements of the mount path array are adjusted for the plugin's context. Consequently, any sub-paths defined within a nested array remain unmodified and do not align with the expected route structure under the prefixed Fastify instance. This mismatch causes the middleware associated with these inner paths to never execute, effectively creating blind spots in the application's request handling pipeline where security checks are skipped entirely.

Furthermore, the vulnerability extends to regular expression-based mount points within nested structures. When a nested regular expression is used for routing, it retains its global or sticky flags from the original Express definition. In JavaScript regex engines, these flags can cause stateful matching behavior where the lastIndex property persists between requests on the same instance. This leads to alternating request patterns being skipped because the regex engine's internal state does not reset correctly in the context of Fastify's high-concurrency environment. Additionally, if case-insensitive matching is disabled at the Fastify level, nested regular expressions are still matched with their original case sensitivity settings, ignoring the global configuration and potentially allowing requests that should be rejected or routed differently to succeed based on casing variations.

Another critical aspect involves dynamic path segments within nested structures. The plugin's earlier logic includes a check for empty segments to prevent certain routing errors, but this validation does not extend to dynamically defined paths inside nested arrays. This oversight means that routes relying on parameterized URLs within these complex mount configurations are not properly validated or secured by the surrounding middleware context. An attacker can exploit these inconsistencies in path resolution and state management to craft requests that bypass authentication mechanisms, authorization checks, or other security-related middleware intended to protect specific endpoints. By leveraging the mismatch between the expected prefixed route and the actual matched route, an adversary can access protected resources without valid credentials, constituting a severe impact on confidentiality and integrity.

This vulnerability aligns with CWE-284 Improper Access Control, as it allows unauthorized actors to bypass security measures due to flawed implementation of protective mechanisms. It also relates to CWE-798 Use of Hard-coded Credentials if the authentication logic is entirely skipped for specific paths, though more accurately it represents a failure in access control enforcement via path manipulation. From an ATT&CK perspective, this flaw facilitates lateral movement or privilege escalation by allowing attackers to bypass initial entry controls and reach sensitive internal services that were assumed to be protected by middleware layers. The root cause is not a lack of security intent but rather a deficiency in the technical execution of route matching algorithms when dealing with complex, nested path definitions common in large-scale Express applications ported to Fastify.

The issue has been addressed in version 4.0.14 and later releases of @fastify/express through corrected logic for rewriting all levels of nested mount paths and proper handling of regex state flags. To mitigate this risk immediately without upgrading, developers should flatten any array-based mount path structures before passing them to the plugin, ensuring that no nested arrays exist that could trigger the buggy resolution logic. Alternatively, security-critical operations such as authentication and authorization checks should be enforced using Fastify hooks like preHandler. These hooks execute after the router has resolved the request context, thereby bypassing the flawed middleware mounting mechanism entirely and ensuring that access controls are applied consistently regardless of how routes are defined or nested within the application structure.

Responsible

Openjs

Reservation

11/23/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00435

KEV

no

Activities

low

Sources

Interested in the pricing of exploits?

See the underground prices here!