GHSA-84W6-XRF3-F8Q8
@fastify/express vulnerable to middleware bypass via RegExp mount paths under parameterized prefixes
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-84W6-XRF3-F8Q8 divulgada · CVSS 9.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
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).
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@fastify/express |
Sin parche | — | — | 4.0.9 afectada |
4.0.10Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/fastify/fastify-express/security/advisories/GHSA-84w6-xrf3-f8q8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
