GHSA-P268-P2W7-QR8X
Bundled LSQUIC has a use-after-free in HTTP/3 header decoding
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:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-P268-P2W7-QR8X divulgada · CVSS 8.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A remote client with no credentials can trigger a use-after-free in a Bun server that has HTTP/3 turned on. The bug is in LSQUIC, the HTTP/3 library that Bun bundles. An LSQUIC maintainer showed that it can lead to remote code execution in another server that uses LSQUIC.
HTTP/3 is experimental and off by default. A server is only exposed if it sets `http3: true` or uses `node:quic`.
Bun 1.4.5 updates LSQUIC to 4.11.2, which fixes the bug.
Details
HTTP/3 compresses headers with QPACK. A set of headers can refer to data that has not arrived yet, so the stream has to wait for it.
While one stream was waiting, LSQUIC kept reading and could start on a second set of headers from the same stream. If the client then reset the stream, LSQUIC freed it but kept one reference to it. Later QPACK data from the client made LSQUIC use that freed memory.
Affected:
- `Bun.serve` with `http3: true`.
- `node:quic`, which uses the same library with the same QPACK decoder settings.
The HTTP/3 client of `fetch` uses the same library. It is only used when you ask for it, with `fetch(url, { protocol: "http3" })` or the `--experimental-http3-fetch` flag. We have not confirmed whether a malicious server can trigger this bug in the client, so treat it as affected.
HTTP/1.1 and HTTP/2 are not affected by this bug.
Executables built with `bun build --compile` embed the Bun runtime. An executable built with an affected version stays affected until it is rebuilt.
Patches
Upgrade to Bun 1.4.5, and rebuild any `bun build --compile` executables with it.
Bun 1.4.5 updates LSQUIC from 4.9.4 to 4.11.2 (#49288). LSQUIC now stops reading a stream while its headers are waiting on QPACK.
Workarounds
Turn off `http3` on any server that untrusted clients can reach, and do not accept `node:quic` connections from untrusted clients. HTTP/1.1 and HTTP/2 keep working.
References
- https://github.com/oven-sh/bun/pull/49288
- https://github.com/litespeedtech/lsquic/blob/v4.11.2/CHANGELOG
- https://bun.com/blog/bun-v1.4.5
Proof of concept
We are not publishing reproduction steps at this time. Details describes the bug at a high level.
To check whether you are affected, run `bun --version`. Versions before 1.4.5 that have HTTP/3 or `node:quic` enabled are affected.
Impact
Memory corruption that a remote client can trigger without credentials. It affects servers that have HTTP/3 turned on or accept `node:quic` connections from untrusted clients.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmbun |
Sin parche | — | — | 1.4.4 afectada |
1.4.5Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/oven-sh/bun/security/advisories/GHSA-p268-p2w7-qr8xLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
