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

Published Nov 26, 2026
·
Updated

@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.

Affected Software

1 affected component
npm/@fastify/express<4.0.14

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@fastify/express to a version that resolves this vulnerability.

    Fixed in 4.0.14
  2. Configuration

    Mount the middleware on a static parent path.

    Express middleware mounted in @fastify/express mount path = static parent path
  3. Configuration

    Require non-empty values in the route params schema.

    Fastify route route params schema = require non-empty values
  4. Compensating control

    Enforce authentication in a Fastify preHandler hook that runs after routing.

Event History

Nov 26, 2026
CVE Published
via MITRE·04:51 PM
Data Sourced
via MITRE·04:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this bypass?

Deployments using @fastify/express before 4.0.14 are affected when Express Router or sub-application middleware is mounted on paths containing dynamic parameters, or when an unanchored regular-expression mount is passed to the plugin. The practical exposure depends on whether an empty parameter can select a Fastify handler protected only by that skipped middleware.

2

What does an attacker need to send to exploit the issue?

An attacker must be able to make a network request to an affected route using an empty dynamic route parameter. No privileges or user interaction are required; the malformed path causes Fastify to reach its handler while Express middleware for that path is skipped.

3

How can this be mitigated before upgrading?

Enforce authentication in a Fastify preHandler hook that runs after routing, mount the middleware on a static parent path, or require non-empty parameter values in the route parameter schema. These measures prevent empty parameter values from bypassing middleware-based controls.

4

How can I determine whether my application may already be affected?

Check whether @fastify/express is below 4.0.14 and review Express Routers and sub-applications for middleware mounted beneath dynamic paths. Test whether requests with an empty value for those parameters reach a Fastify route handler without the expected authentication or other middleware running.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203