Executive brief
undici is a popular HTTP client library for Node.js used in many web applications. A flaw in its retry mechanism can cause response bodies to hang indefinitely when a server returns truncated data followed by an error status, preventing the application from closing those connections and exhausting available resources. An attacker controlling a server can exploit this to cause a denial of service by accumulating pending promises and memory leaks.
Technical details
The vulnerability is a resource leak (CWE-772) in undici's RetryHandler. When a retried HTTP request receives a successful response with Content-Length but only partial body data followed by connection close, the retry logic fetches a new request. If that retry returns a non-retryable status (e.g., 400), the handler forwards the new response and replaces its internal stream, but the original partial response body held by the application is never ended or destroyed. This leaves read operations like response.body.text() hanging indefinitely; the configured bodyTimeout does not fire because its timer is tied to the connection parser, not the orphaned body. A remote attacker can repeatedly trigger this by controlling a server that sends two short responses without keeping connections open, accumulating pending promises and streams that exhaust application concurrency or memory. The issue affects undici 7.11.0–7.29.0 and 8.0.0–8.10.1; patches are available in 7.29.1 and 8.10.2.
Affected products
- OpenJS Foundation undici 7.11.0 to 7.29.0, 8.0.0 to 8.10.1
Timeline
- 2026-09-04: disclosed
- 2026-09-04: patched: undici 7.29.1 and 8.10.2