CVE-2026-135264: @fastify/express vulnerable to middleware bypass via nested arrays of mount paths

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

Affected Software

1 affected component
npm/@fastify/express>=4.0.7<4.0.14

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 4.0.14
  2. Compensating control

    Flatten mount path arrays before passing them to @fastify/express, or enforce authentication in a Fastify preHandler hook that runs after the router resolves the request.

Event History

Nov 26, 2026
CVE Published
via MITRE·04:56 PM
Data Sourced
via MITRE·04:56 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are affected?

Deployments using @fastify/express versions 4.0.7 through 4.0.13 are affected when middleware is mounted using nested arrays of mount paths. The risk is particularly significant where that middleware enforces authentication or other access controls and the Fastify plugin is registered under a prefix.

2

What does an attacker need to exploit this issue?

An attacker only needs network access to send requests to affected routes; no credentials or user interaction are required. Exploitation depends on the application using one of the affected nested mount-path patterns, allowing the middleware to be skipped or inconsistently matched.

3

How can I mitigate the issue if I cannot upgrade immediately?

Flatten mount-path arrays before passing them to the plugin. Alternatively, enforce authentication in a Fastify hook such as preHandler, which runs after the router resolves the request.

4

How can I determine whether my application is exposed?

Check whether @fastify/express is version 4.0.7 through 4.0.13 and inspect middleware registrations for nested arrays of mount paths. Pay particular attention to nested regular expressions, dynamic paths, and middleware registered beneath a Fastify plugin prefix.

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