CVE-2026-135279 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 before 4.0.14, a request with an empty dynamic route parameter reaches a Fastify route handler while middleware mounted for that path inside an Express Router or sub-application is skipped, because Fastify's router accepts an empty value where Express requires a non-empty one, and an unanchored regular-expression mount passed to the plugin is bypassed the same way. An earlier fix covered only the mount paths passed to the plugin directly, not middleware mounted inside a routed Express application. An attacker can use this to bypass authentication or other middleware-based access controls on the affected routes, with the practical impact depending on what the empty value selects in the application. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, enforce authentication in a Fastify hook such as preHandler that runs after routing, mount the middleware on a static parent path, or require non-empty values in the route params schema.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/26/2026

The @fastify/express plugin serves as a critical bridge allowing developers to integrate Express middleware and applications within the Fastify web framework ecosystem. This integration is particularly valuable for leveraging existing Express-based libraries or legacy codebases while benefiting from Fastify’s performance characteristics. However, in versions prior to 4.0.14, this interoperability layer contained a significant logic flaw related to how dynamic route parameters are validated and processed during the request routing phase. The vulnerability stems from a discrepancy between the validation rules applied by Fastify’s native router and those enforced by Express middleware when mounted via an Express Router or sub-application. Specifically, Fastify’s internal routing mechanism accepts requests with empty values for dynamic path segments as valid matches, whereas standard Express behavior typically requires these parameters to be non-empty strings to satisfy route definitions.

This divergence in validation logic creates a bypass opportunity where a request containing an empty string for a dynamic parameter can successfully reach the underlying Fastify route handler. Crucially, any middleware mounted within an associated Express Router or sub-application is skipped during this process because it fails its own internal check for non-empty parameters. This behavior was not fully addressed by earlier patches that only corrected issues with mount paths passed directly to the plugin itself, leaving a gap where nested Express applications remained vulnerable. An unanchored regular expression used in mounting middleware can also be bypassed using similar techniques, further expanding the attack surface. The core technical flaw is essentially a path traversal or parameter validation inconsistency that allows an attacker to circumvent intermediate processing layers intended for security enforcement.

The operational impact of this vulnerability is severe, primarily centering on authentication and authorization bypasses. Since middleware mounted inside Express Routers often handles critical security functions such as session verification, token validation, or role-based access control, skipping these middlewares effectively neutralizes them for affected routes. An attacker can craft requests with empty dynamic parameters to reach protected endpoints without satisfying the required preconditions enforced by the skipped middleware. The practical severity depends heavily on how the application interprets an empty parameter value; if the backend logic treats an empty string as a valid identifier or default state, it may grant unauthorized access to sensitive resources. This aligns with CWE-284 Improper Access Control and CWE-601 URL Redirection to Untrusted Site, as the routing mechanism fails to properly restrict access based on input validation rules.

From a threat modeling perspective using MITRE ATT&CK, this vulnerability facilitates techniques associated with Privilege Escalation or Defense Evasion by allowing unauthorized users to bypass security controls that are not explicitly enforced at the Fastify route handler level but rather in upstream middleware layers. The lack of consistent parameter validation across different parts of the request handling pipeline creates a blind spot for security monitoring and access control systems. To mitigate this risk, developers must upgrade to @fastify/express version 4.0.14 or later, which corrects the routing logic to ensure that empty dynamic parameters are rejected consistently with Express standards. For environments where immediate upgrading is not feasible, alternative mitigation strategies include enforcing authentication checks within Fastify hooks such as preHandler, which execute after routing decisions have been made and thus bypass the middleware skipping issue. Additionally, mounting security-critical middleware on static parent paths rather than relying solely on dynamic route matching can help ensure that access controls are applied uniformly regardless of parameter values. Another effective workaround involves strictly validating route parameters in the schema to explicitly require non-empty strings, thereby preventing empty value requests from reaching handlers with insufficient downstream protection.

Responsible

Openjs

Reservation

11/23/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00756

KEV

no

Activities

low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!