RegExp middleware bypass in @fastify/express via encoded line terminators
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA.
Summary
@fastify/express, which runs Express middleware and applications inside Fastify, is affected from 4.0.3 before 4.0.14. It decodes some percent-encoded characters in the request path, including the Unicode line and paragraph separators, and leaves them raw. A JavaScript regular expression treats these as line terminators, so a regex mount path using the dot metacharacter fails to match such a request, while Fastify still routes it to the handler and the mounted middleware is skipped. An attacker can bypass authentication or other middleware-based access controls on routes guarded by a regex mount (CWE-185), but string mount paths are not affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-26
Description from the CNA
@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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| @fastify/express | @fastify/express | 4.0.3 to before 4.0.14 | 4.0.14 | Patch available | CNA |
- @fastify/express Vendor@fastify/express Affected 4.0.3 to before 4.0.14 Fixed in 4.0.14 Patch available CNA
Remediation
Upgrade @fastify/express to version 4.0.14 or later, which fixes the issue. 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.
Written with Claude Haiku 5.5 from the sources below · 2026-11-26
- Fix · CNA @fastify/express (@fastify/express) Fixed in 4.0.14
Fixed in the same release
Records fixed by the same vendor advisory or release, as the CNA lists them.
- Release ·
@fastify/express 4.0.14
5 records Highest priority Priority MEDIUM 1 MEDIUM, 4 LOW
Other records, highest priority first
- TI-2026-99002 Middleware bypass via empty route parameters in @fastify/expressPriority MEDIUM 41
- TI-2026-99003 Middleware bypass in @fastify/express with case-insensitive routingPriority LOW 33
- TI-2026-99001 Middleware bypass in @fastify/express via optional group mount pathsPriority LOW 33
Timeline
- 2026-11-26 Threatist record created from CVE-2026-135230
References
More @fastify/express vulnerabilities
- TI-2026-96437 @fastify/express path-scoped middleware bypass via URL decoding mismatch CVSS 3.1CRITICAL 9.1
- TI-2026-96435 Path-scoped middleware bypass in @fastify/express skips authentication checks CVSS 3.1CRITICAL 9.1
- TI-2026-96434 Middleware bypass in @fastify/express via empty route parameters CVSS 3.1CRITICAL 9.1
- TI-2026-96433 @fastify/express middleware bypass via RegExp mounts under parameterized prefix CVSS 3.1CRITICAL 9.1
- TI-2026-81130 Middleware bypass in @fastify/express via absolute-form URLs CVSS 3.1CRITICAL 9.1
- TI-2026-99002 Middleware bypass via empty route parameters in @fastify/express CVSS 3.1CRITICAL 9.1
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences