GHSA-F44M-4QWG-5587
@fastify/express vulnerable to path-scoped middleware bypass via prefix and mount path join mismatch
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-F44M-4QWG-5587 divulgada · CVSS 9.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
`@fastify/express` joins a path-scoped middleware's mount path to the Fastify plugin prefix by string concatenation. When the plugin prefix ends with a slash, or the mount path passed to `use()` omits its leading slash, the resulting Express mount path does not line up with the route the Fastify router serves. Express fails to match and calls the next handler, while the Fastify router still dispatches the route, so the middleware is silently skipped.
Applications that use path-scoped Express middleware for authentication or authorization inside prefixed Fastify plugins can expose protected routes to unauthenticated clients. No non-default option is required, and the request needs no crafting. String, array, and RegExp mount paths are all affected.
Patches
Patched in `@fastify/express` 4.0.10.
Workarounds
Write the mount path so it lines up with the served route: give the mount path a leading slash and do not end the plugin prefix with a slash, so the two join cleanly (for example a `/api` prefix with `use('/secret', ...)` yields `/api/secret`).
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-f44m-4qwg-5587Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
