CVE-2026-135279

@fastify/express vulnerable to middleware bypass via empty route parameters in Express routers and sub-applications

Published Nov 26, 2026 CVSS 3.1 · 9.1 Critical EPSS n/a KEV · Not listed
Description
@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.

Analysis

AI-generated

Technical impact

The vulnerability is in the @fastify/express plugin, which allows Express middleware and applications to run inside the Fastify framework. In versions prior to 4.0.14, a request containing an empty dynamic route parameter is accepted by Fastify’s router but an Express middleware or sub‑application mounted for that exact path is not executed. Because Express requires non‑empty route parameters, the middleware is skipped. Likewise, an unanchored regular‑expression mount passed to the plugin can be bypassed. This behavior lets an attacker bypass authentication or other access‑control checks that rely on the Express middleware, potentially granting unauthorized access to protected resources. The practical impact depends on what the empty route value selects within the application, but the weakness can lead to full privilege escalation if critical endpoints are exposed.

Affected Systems

The affected product is the Node.js @fastify/express module, used to integrate Express middleware into Fastify applications. All releases of @fastify/express earlier than version 4.0.14 are impacted. Systems that use Fastify as a web framework and mount Express routers or sub‑applications through this plugin are at risk.

Risk and Exploitability

The CVSS score of the issue is 9.1, indicating a high severity. The EPSS score is not available, so the current exploitation probability cannot be quantified from the data. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is an HTTP request crafted to trigger the bypass; an attacker needs network access to the application and must inject a route with an empty dynamic segment. Because only the Express middleware is affected, the attacker can gain access to endpoints protected solely by that middleware without needing additional privileges.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the @fastify/express module to version 4.0.14 or later.
  • If an immediate upgrade is not possible, add a Fastify preHandler hook that enforces authentication after routing to ensure the middleware chain is still executed.
  • Configure Express middleware mounts to use a static parent path or apply schema validation to route parameters to reject empty values.

Generated by OpenCVE AI on November 26, 2026 at 18:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description @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.
Title @fastify/express vulnerable to middleware bypass via empty route parameters in Express routers and sub-applications
Weaknesses CWE-287
CWE-436
References
Metrics cvssV3_1

{'score': 9.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N'}

Subscriptions

No data.

Weaknesses

Sources

Status
PUBLISHED
Assigner
openjs
Published
Updated
Nov 26, 2026, 4:51 PM
Reserved
Nov 23, 2026, 4:15 PM
Status
Received
Published
Nov 26, 2026, 5:17 PM
Modified
Nov 26, 2026, 5:17 PM