# GHSA-84W6-XRF3-F8Q8: @fastify/express vulnerable to middleware bypass via RegExp mount paths under parameterized prefixes

- Database: GitHub
- Severity: CVSS 9.1 (Critical)
- Published: 2026-11-20
- Modified: 2026-11-20

## Tracked as

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

## Affected versions

- @fastify/express (npm): from 4.0.7, fixed in 4.0.10

## Description

### Impact

`@fastify/express` does not rewrite RegExp mount paths to account for a parameterized Fastify plugin prefix. When a plugin is registered under a parameterized prefix (for example `/tenant/:tenantId`) and middleware is mounted with a RegExp (for example `app.use(/^\/private/, authMiddleware)`), the plugin prefix is treated as literal text when the Express matcher is built, so the matcher expects the literal `:tenantId` instead of a concrete value such as `acme`. Express never matches the mount against the real URL and silently skips the middleware, while Fastify still runs the route handler.

Applications that use RegExp-mounted Express middleware for authentication or authorization inside a parameterized-prefix plugin can expose protected routes to unauthenticated clients. No special configuration is required beyond a parameterized prefix and a RegExp mount; the default router settings are sufficient.

### Patches

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

### Workarounds

Enforce authentication in a Fastify hook (such as `preHandler`) that runs after the router resolves the request, or avoid RegExp mount paths under parameterized plugin prefixes (use a string mount path, or move the parameter out of the prefix).

## References

- https://github.com/fastify/fastify-express/security/advisories/GHSA-84w6-xrf3-f8q8

Page: https://cve.now/GHSA-84W6-XRF3-F8Q8
