GHSA-39Q9-QP46-W8XG
`bodyLimit()` keeps every transfer chunk of a request body in memory, allowing memory exhaustion with tiny chunks
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-39Q9-QP46-W8XG divulgada · CVSS 5.3 (GitHub) | |
| Remediación | Parche 4.13.18 | hono · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Since 4.12.16, `bodyLimit()` reads the whole request body before the handler runs so that the limit also applies to chunked requests. It kept every chunk delivered by the runtime as a separate array and later replayed them. A client that sends the body in very small transfer chunks makes the middleware retain millions of small arrays for a body that is within the configured limit. The memory used is many times the body size, and the process can be terminated before the handler runs.
Details
The size check counted the payload bytes correctly, so the configured `maxSize` was respected. The problem is the per-chunk overhead: each `Uint8Array` the runtime delivers was kept as its own object until the body was complete, then enqueued again into a new stream. With one-byte HTTP transfer chunks, a 10 MiB upload becomes about ten million retained objects.
`bodyLimit()` now copies the incoming chunks into one buffer that grows up to `maxSize`, and forwards that buffer as the request body. Memory use is bounded by the configured limit regardless of how the body is chunked.
Observed on Bun and Node.js, where the HTTP parser delivers transfer chunks as they arrive.
Impact
An unauthenticated client can exhaust the memory of a server that uses `bodyLimit()` with a single request that stays within the configured limit, terminating the process.
This issue affects applications that use `bodyLimit()` on runtimes that deliver small transfer chunks individually, such as Bun and Node.js.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmhono |
Corregida | 4.13.18 | 0 d | 4.13.19 no afectada |
4.13.18Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/honojs/hono/security/advisories/GHSA-39q9-qp46-w8xgLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
