GHSA-6RMC-F24G-HMP6
@fastify/express vulnerable to path-scoped middleware bypass via Unicode case folding
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/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-6RMC-F24G-HMP6 divulgada · CVSS 7.4 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
When Fastify routing is case-insensitive (`routerOptions.caseSensitive: false`), find-my-way folds the request path with `toLowerCase()`, which maps the Unicode character U+212A KELVIN SIGN to the ASCII letter `k`. `@fastify/express` passes Express the decoded path without applying that folding, and Express matches mount paths with a case-insensitive regular expression that does not fold non-ASCII characters. The two disagree, so a request such as `/api/%E2%84%AAeys` is routed to the `/api/keys` handler while a path-scoped middleware mounted at `/api/keys` (authentication, authorization, rate limiting) never matches and is skipped. An unauthenticated client reaches the protected handler by spelling a `k` in the mount path as `%E2%84%AA`. Only a mount path containing `k` is affected, and only when the application enables `caseSensitive: false`.
Patches
Upgrade to `@fastify/express` `4.0.10` or later. The request path Express matches path-scoped middleware on is now folded with the same `toLowerCase()` the router uses when `caseSensitive` is `false`.
Workarounds
Enforce authorization in a Fastify hook (such as `preHandler`) that runs after the router has resolved the request, rather than relying solely on a path-scoped Express middleware. Leaving routing case-sensitive (the default) also avoids the issue.
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-6rmc-f24g-hmp6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
