CVE-2026-84890: undici vulnerable to Denial of Service via unbounded decompression of compressed responses
Impact
The interceptors.decompress() interceptor decompresses HTTP response bodies according to the untrusted Content-Encoding header. The number of decompression layers is capped at 5, but the total decompressed output size is not bounded and there is no option to limit it. A malicious or faulty upstream can return a small compressed payload (a compression bomb) that expands to hundreds of megabytes or gigabytes in client memory, exhausting memory and causing the Node.js process to crash or become unresponsive. Any application using the decompress interceptor to read responses from untrusted or compromised upstreams is affected.
Patches
Upgrade to 7.29.1 or 8.10.2. The interceptor now accepts a maxSize option (default 64 MiB) and rejects responses whose decompressed output exceeds it with a ResponseExceededMaxSizeError.
Workarounds
Once upgraded, set a conservative maxSize on the interceptor. Before upgrading, avoid using interceptors.decompress() with untrusted upstreams, or apply a custom interceptor that enforces a decompressed output size limit.
Other sources
undici's decompress interceptor decompresses response bodies according to the untrusted Content-Encoding header. While the number of content-encoding layers is capped, the total decompressed output size is unbounded and there is no configuration option to limit it. A malicious or faulty upstream can therefore return a small compressed payload, a compression bomb, that expands to hundreds of megabytes or more in client memory, an asymmetric resource consumption that can exhaust memory and crash the process. This affects undici versions from 7.15.0 up to 7.29.1 and from 8.0.0 up to 8.10.2. Users should upgrade to undici 7.29.1 or 8.10.2.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 8.10.2 - Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 7.29.1 - Upgrade
Upgrade
undicito a version that resolves this vulnerability.Fixed in 7.29.1 - Upgrade
Upgrade
undicito a version that resolves this vulnerability.Fixed in 8.10.2 - Configuration
Set the interceptor's maxSize option to a conservative decompressed-output limit; the option defaults to 64 MiB and rejects responses exceeding the limit.
undici interceptors.decompress() maxSize = 64 MiB - Compensating control
Before upgrading, avoid using interceptors.decompress() with untrusted upstreams, or use a custom interceptor that enforces a decompressed output size limit.
Event History
Frequently Asked Questions
What must an attacker control to trigger the memory exhaustion?
An attacker, or a faulty upstream service, must be able to return a compressed HTTP response to the undici client with an untrusted Content-Encoding header. The compressed body can be small but expand to hundreds of megabytes or more during decompression, potentially crashing the process.
Is there a setting to cap the decompressed response size as an interim mitigation?
No. The decompress interceptor has no configuration option to limit the total decompressed output size. Although the number of content-encoding layers is capped, that cap does not bound the final decompressed size.
How can I determine whether a deployment is in the listed affected range?
Check the installed undici version. The supplied advisory lists versions from 7.15.0 through 7.29.1 and from 8.0.0 through 8.10.2 as affected; it also recommends upgrading to 7.29.1 or 8.10.2.