CVE-2026-135205: @fastify/middie vulnerable to middleware bypass via mount paths without a leading slash in prefixed plugins

Published Nov 26, 2026
·
Updated

@fastify/middie is the plugin that adds Express-style middleware support to the Fastify web framework. In versions 9.3.6 through 9.3.9, a route or mount path written without a leading slash inside a plugin registered under a prefix is handled inconsistently: the middleware is mounted with a separating slash after the prefix, while the route is concatenated directly onto the prefix, so a request to the concatenated path reaches the route handler without running the middleware mounted for it. An attacker can use this to bypass authentication or other middleware-based access controls on the affected routes. The issue is fixed in @fastify/middie 9.3.10, and users should upgrade to 9.3.10 or later. As a workaround, begin all route and mount paths with a slash, 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/middie>=9.3.6<=9.3.9

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 9.3.10
  2. Compensating control

    As a workaround, begin all route and mount paths with a slash, 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:43 PM
Data Sourced
via MITRE·04:43 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this bypass?

Applications using @fastify/middie versions 9.3.6 through 9.3.9 are exposed when a plugin is registered with a prefix and contains a route or middleware mount path that does not begin with a slash. The impact is greatest where the skipped middleware enforces authentication or another access control.

2

What does an attacker need to exploit the issue?

An attacker only needs network access to send a request to the affected concatenated route path. No credentials or user interaction are required, but the application must have the affected prefixed-plugin path configuration.

3

Are all @fastify/middie deployments affected by default?

No. The bypass depends on the specific combination of a prefixed plugin and route or mount paths written without a leading slash. Deployments that do not use that pattern are not described as affected.

4

What can be done before upgrading?

Ensure every route and middleware mount path begins with a slash. Alternatively, enforce authentication in a Fastify hook such as preHandler, which runs after route resolution.

5

How can I check whether my application is affected?

Review prefixed Fastify plugins for route definitions or middie mount paths that omit the leading slash. Test the resulting concatenated request path to confirm that middleware-based controls execute before the route handler.

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