GHSA-662W-H4P6-JQ4P
@fastify/express vulnerable to middleware bypass via empty route parameters and wildcards
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-662W-H4P6-JQ4P divulgada · CVSS 9.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
`@fastify/express` matches path-scoped Express middleware with `path-to-regexp`, which requires a non-empty value for a dynamic segment, while Fastify's router (find-my-way) accepts an empty parameter or wildcard. When a route and an Express middleware mount share a dynamic pattern, a request with an empty segment such as `GET /tenant/` or `GET /files/` matches the Fastify route and runs the handler while the middleware mounted on that pattern is skipped. On a scoped mount such as `app.use('/tenant/:tenantId', authMiddleware)`, an unauthenticated request can reach the protected handler. The default router configuration is sufficient. The practical impact depends on what the empty value selects in the application.
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 has resolved the request, or mount the middleware on a static parent path (for example `/tenant` instead of `/tenant/:tenantId`) so that an empty dynamic segment cannot skip it.
References
- GHSA-6h42-57hq-9746
https://github.com/fastify/fastify-express/security/advisories/GHSA-6h42-57hq-9746(CVE-2026-112362), a related `@fastify/express` path-scoped middleware bypass - GHSA-3wf5-7852-vcfq
https://github.com/fastify/fastify-express/security/advisories/GHSA-3wf5-7852-vcfq(CVE-2026-6556), a related `@fastify/express` middleware bypass via non-string mount paths
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-662w-h4p6-jq4pLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
