GHSA-FJ57-4F93-CFW6
`serveStatic` with `allowPercentInPath` decodes the request path a second time, leading to bypass of middleware on static paths
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-FJ57-4F93-CFW6 divulgada · CVSS 5.3 (GitHub) | |
| Remediación | Parche 2.1.7 | @hono/node-server · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
`serveStatic` has an opt-in option, `allowPercentInPath`, for serving files whose names contain a literal `%`. With it enabled, the check added for GHSA-rmxm-3fg6-px4f that rejects a path containing `%` is skipped, and the path is decoded a second time. A crafted request can be routed as one path and served as another, so middleware mounted on a static prefix does not run for a file under that prefix.
Details
Hono decodes the request path once before routing. With a malformed percent-encoded sequence, that decode leaves part of the path encoded, the router matches the encoded form, and the second decode in `serveStatic` resolves the real directory. The option skipped the check without limiting what the second decode may change.
`serveStatic` now accepts a path that still contains `%` only when the second decode changes nothing except `%25`, the escape for a literal `%`. Anything else is treated as not found. File names such as `100%.txt` keep working. The file is still resolved inside the configured root; this is not a traversal outside it.
Impact
An unauthenticated attacker may reach static files without the middleware on their prefix running, for example an authentication check. This affects applications that set `allowPercentInPath: true` and mount middleware on part of the directory served by `serveStatic`. The default configuration was fixed in 2.1.3 and is not affected.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@hono/node-server |
Corregida | 2.1.7 | 0 d | 2.1.11 no afectada |
2.1.7Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/honojs/node-server/security/advisories/GHSA-fj57-4f93-cfw6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
