# GHSA-X6W9-3QCM-VP2J: @fastify/express vulnerable to RegExp middleware bypass via encoded line terminators

- Database: GitHub
- Severity: CVSS 7.4 (High)
- Published: 2026-11-26
- Modified: 2026-11-26

## Tracked as

- [CVE-2026-135230](https://cve.now/CVE-2026-135230.md): Fastify Express auth bypass in RegExp middleware mounts

## Affected versions

- @fastify/express (npm): from 4.0.3, fixed in 4.0.14

## Description

### Impact

`@fastify/express` decodes the request path the way Fastify's router does before handing it to Express ([GHSA-g6q3-96cp-5r5m](https://github.com/fastify/fastify-express/security/advisories/GHSA-g6q3-96cp-5r5m), [GHSA-w877-hjcp-88rc](https://github.com/fastify/fastify-express/security/advisories/GHSA-w877-hjcp-88rc)), and percent-encodes again the characters that would make Express parse it differently. `%E2%80%A8` and `%E2%80%A9` are decoded to U+2028 and U+2029, which stay raw, and which a JavaScript regular expression treats as line terminators: `.` does not match them, and with the `m` flag `^` and `$` match around them. Plain Express sees them percent-encoded.

A RegExp mount path that relies on `.`, such as `fastify.use(/^\/admin(?:\/.*)?$/, auth)`, therefore does not match `GET /admin/users/42%E2%80%A8`, while Fastify routes it to `/admin/users/:id` with the parameter `42\u2028`, so the handler runs without the middleware. String mount paths are not affected.

### Patches

Upgrade to `@fastify/express` 4.0.14 or later.

### Workarounds

Use string mount paths, use `[^]` or the `s` flag instead of `.` in RegExp mount paths, or enforce authentication in a Fastify hook (such as `preHandler`) that runs after the router has resolved the request.

## References

- https://github.com/fastify/fastify-express/security/advisories/GHSA-x6w9-3qcm-vp2j

Page: https://cve.now/GHSA-X6W9-3QCM-VP2J

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
