CVE-2026-135230: @fastify/express vulnerable to RegExp middleware bypass via encoded line terminators

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.3 before 4.0.14, the plugin decodes certain percent-encoded characters in the request path that Express would otherwise keep encoded, including the Unicode line separator and paragraph separator characters, and leaves them raw. A JavaScript regular expression treats those two characters as line terminators, so a regular-expression mount path that relies on the dot metacharacter fails to match a request containing them while Fastify's own router still routes the request to its handler, and the middleware mounted on that regular-expression path is therefore skipped. An attacker can use this to bypass authentication or other middleware-based access controls on routes guarded by a regular-expression mount; string mount paths are not affected. The issue is fixed in @fastify/express 4.0.14, and users should upgrade to 4.0.14 or later. As a workaround, use string mount paths, avoid the dot metacharacter in regular-expression mounts by using a character class or the dotAll flag, 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.3<4.0.14

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 4.0.14
  2. Compensating control

    For regular-expression mount paths, use string mount paths, avoid the dot metacharacter by using a character class or the dotAll flag, or enforce authentication in a Fastify preHandler hook.

Event History

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

Frequently Asked Questions

1

Which deployments are affected?

Deployments using @fastify/express versions 4.0.3 through 4.0.13 are affected when security-relevant middleware is mounted on a regular-expression path that relies on the dot metacharacter. String mount paths are not affected.

2

What does an attacker need to do to bypass the middleware?

An unauthenticated remote attacker can send a request path containing percent-encoded Unicode line separator or paragraph separator characters. These characters can cause the regular-expression mount not to match while Fastify still routes the request to its handler.

3

What should be done if an immediate upgrade is not possible?

Replace affected regular-expression mount paths with string mount paths where possible. Otherwise, avoid the dot metacharacter by using a character class or the dotAll flag, and ensure authentication is not solely dependent on the affected middleware mount.

4

How can I determine whether routes are exposed?

Review Express middleware mounted through the plugin for regular-expression paths, especially mounts protecting authentication or authorization. Prioritize expressions using a dot metacharacter and test requests containing percent-encoded Unicode line or paragraph separators.

5

What is the permanent fix?

Upgrade @fastify/express to version 4.0.14 or later.

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