NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-87029: undici vulnerable to Denial of Service via unhandled exception in the decompress interceptor

mediumCVSS 3.1 5.9GHSA-55wc-3pg8-jfw6

undici's decompress interceptor lets a malicious or compromised HTTP server crash a Node.js client. If the client pairs decompress with a handler that throws, such as dump with maxSize, a small compressed body that expands past the limit raises an uncaught exception and ends the process. Fixed in undici 7.30.1 and 8.12.2.

Published Oct 27, 2026 · Analysis Nov 1, 2026

What an attacker can do

The decompress interceptor passes decompressed data to the downstream handler from zlib stream event callbacks. undici normally turns a synchronous throw from a handler into a failure of that one request. A throw from a zlib callback is asynchronous, so that protection does not apply. The exception escapes and terminates the process.

The built-in dump interceptor throws when a response exceeds its maxSize, so the combination decompress plus dump is vulnerable by design. The attacker is a server your client talks to. It can be malicious, or a legitimate server that was compromised. It returns a compressed body that is tiny on the wire but decompresses past the limit. Only the decompressed size matters.

The result is a denial of service: the whole Node.js process exits, which drops every other in-flight request. If the app installs a global uncaughtException handler, the process survives, but the affected request hangs until the body timeout. The advisory reports no confidentiality or integrity impact. Attack complexity is rated high because the client must use this specific interceptor composition.

Who is affected

undici from 7.15.0 up to but not including 7.30.1, and from 8.0.0 up to but not including 8.12.2. You are exposed only if your code composes the decompress interceptor with a response handler that can throw during processing, such as dump with maxSize. Check the installed version, including nested copies:

npm ls undici

Then search your code for interceptors.decompress.

undici

Ecosystem
npm
Affected
>= 7.15.0, < 7.30.1
Fixed in
7.30.1
Check
npm ls undici

undici

Ecosystem
npm
Affected
>= 8.0.0, < 8.12.2
Fixed in
8.12.2
Check
npm ls undici

How to fix it

Upgrade to undici 7.30.1 on the 7.x line or 8.12.2 on the 8.x line:

npm install [email protected]

On 8.x use npm install [email protected]. If a dependency pins its own undici, update that dependency or use an npm override. Until you upgrade, the advisory's workaround is to not combine the decompress interceptor with a handler that throws during response processing, such as dump with a maxSize.

How to tell if you were hit

Look for Node.js processes that exit or restart after an outbound request, with an uncaught exception stack that passes through zlib callbacks and the dump interceptor's maxSize error. In apps with a global uncaughtException handler, look for outbound requests that stall until the body timeout. Review which upstream servers returned highly compressible responses just before the failures.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

undici's decompress interceptor forwards decompressed response data to the downstream handler from zlib stream event callbacks without catching exceptions those callbacks may throw. undici's engine converts a synchronous throw from a downstream handler into a per-request failure, but that protection is not in place when the throw happens asynchronously from a zlib callback. As a result, a downstream handler that throws by design, for example the built-in dump interceptor which throws when a response exceeds its maxSize, escapes as an uncaught exception and terminates the Node.js process.

A malicious or compromised HTTP server can crash any client that composes the decompress interceptor with dump (or another response handler that throws), by returning a small compressed body that decompresses to more than the configured limit. The compressed bytes on the wire are tiny, so only the decompressed size matters. If the application keeps the process alive with a global uncaught-exception handler, the affected request instead hangs until the body timeout.

Patches

Upgrade to undici 7.30.1 or 8.12.2.

Workarounds

Avoid composing the decompress interceptor with a response handler that throws during response processing (such as dump with a maxSize) until upgrading.

Credited to Yanhaoxi, mcollina, UlisesGascon.

Questions

Do I need to be running a server to be affected by this undici bug?

No. The flaw is in the HTTP client. Your process is at risk when it makes requests through undici with the decompress interceptor and a throwing handler, and the remote server returns a crafted compressed body.

Does a global uncaughtException handler protect me?

It keeps the process alive, but the affected request then hangs until the body timeout, according to the advisory. The request still fails.

Which undici versions fix this?

7.30.1 for the 7.x line and 8.12.2 for the 8.x line. Versions before 7.15.0 are not listed as affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More npm vulnerabilities

All npm entries