undici vulnerable to downstream response splitting via retry interceptor
### Impact Undici's `interceptors.retry()` can resume a request after a partial response and append the resumed bytes to an already partially delivered body, while the application still receives the original response's status and headers. When that response carried a `Content-Length`, the application can receive a longer body. Applications that forward Undici's status, headers, and body downstream without recalculating framing, for example proxy or gateway applications, may emit a response whose body exceeds the forwarded `Content-Length`, and the excess bytes can be read as the start of a subsequent HTTP response (downstream response splitting or desynchronization). For example, a `404 Not Found` with `Content-Length: 2` that sends one byte then closes can be resumed with an open-ended `Range` request, and the resumed `206 Partial Content` bytes are appended, so the application receives more than two body bytes while still seeing `Content-Length: 2`. The bug requires `interceptors.retry()` enabled, an attacker-controlled or faulty upstream, and a downstream forwarder that does not recalculate `Content-Length`. ### Patches Patched in undici v6.28.1, v7.29.1, and v8.10.2. Upgrade to one of these or later. ### Workarounds - Disable `interceptors.retry()` for untrusted upstreams, or set `maxRetries: 0`. - Remove or recalculate `Content-Length` before forwarding a response body assembled by Undici.
describes (1)
Related CVEs.
| ID | severity | exploitable | ||
|---|---|---|---|---|
| CVE-2026-18540US | — | — | ||
undici's retry interceptor can append the body of a ranged retry response to bytes already delivered from an earlier partial response while still presenting the original response's… | ||||
references
External citations — patches, advisories, analysis.
- https://cna.openjsf.org/security-advisories.htmlWEB
- https://github.com/nodejs/undiciPACKAGE
- https://github.com/nodejs/undici/commit/0160a719063fb0a77f4fdf9500b9166b91e14329WEB
- https://github.com/nodejs/undici/commit/cd8af90b38ae33c2838d54a2d629774122effe95WEB
- https://github.com/nodejs/undici/commit/ce31bc824b578008faae5d3350da66c1b5f71548WEB
- https://github.com/nodejs/undici/releases/tag/v6.28.1WEB
- https://github.com/nodejs/undici/releases/tag/v7.29.1WEB
- https://github.com/nodejs/undici/releases/tag/v8.10.2WEB
Advisories like this name the exposed products attackers go after on your perimeter. See what is exposed on your perimeter with a free passive scan.
Free scan