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

CVE-2026-109869: undici vulnerable to Denial of Service via unhandled error on excessive content-encodings

highCVSS 3.1 7.5GHSA-xjj6-f33q-929c

undici's fetch() can crash the whole Node.js process when a malicious server sends a response with more than five content codings and closes the connection before the body. Catching the fetch() rejection does not help. Upgrade to undici 6.29.1, 7.30.1 or 8.12.2.

Published Oct 23, 2026 · Analysis Nov 1, 2026

What an attacker can do

undici limits the number of content-encoding codings it accepts and rejects responses over the limit. Before the fix it had already created the internal response body stream when it ran that check, and it returned without attaching an error listener or aborting the request. When the server then closed the connection early, a content-length mismatch error surfaced on that orphaned stream. Node.js treats an error event with no listener as an uncaught exception and terminates the process (CWE-248, CWE-459).

The attacker needs only to run a server your code fetches from, or to sit in the path of the request. No authentication or user interaction is needed, and one response is enough. The application's own try/catch around fetch() does not prevent the crash, because the error is raised on the internal stream, not on the returned promise.

The impact is availability only. Services that fetch user-supplied URLs are most at risk, such as webhook senders, link previewers, crawlers, and AI agents or tools that fetch web pages. One bad URL can take down the whole agent or API process. A process manager that restarts it limits the outage but not repeated crashes.

Who is affected

The npm package undici in three ranges: 6.23.0 up to before 6.29.1, 7.18.0 up to before 7.30.1, and 8.0.0 up to before 8.12.2. Check the version that your project resolves, including copies pulled in by other packages:

npm ls undici

Node.js bundles its own undici for its built-in fetch; the advisory covers the npm package.

undici

Ecosystem
npm
Affected
>= 6.23.0, < 6.29.1
Fixed in
6.29.1
Check
npm ls undici

undici

Ecosystem
npm
Affected
>= 7.18.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 6.29.1, 7.30.1 or 8.12.2, depending on your major line.

npm install [email protected]
npm install [email protected]
npm install [email protected]

The fixed versions check the content-encoding chain before creating the internal body stream and abort the response when the limit is exceeded. The advisory lists no workaround.

How to tell if you were hit

Look for Node.js processes that exit or restart after outbound fetches, with an uncaught error event whose stack goes through undici and mentions a content-length mismatch. Check which outbound URL was being fetched at the time, and whether the response header listed many comma-separated content-encoding values.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

undici's fetch() crashes the Node.js process when a malicious server returns a response with more than five content codings and closes the connection before sending the body. undici rejects such responses (a content-encoding limit), but it created the internal response stream before that check and returned without attaching an error listener or aborting the request. The early close then surfaces a content-length mismatch on that orphaned internal stream, which Node.js treats as an unhandled error and terminates the process. A remote, unauthenticated server can trigger this with a single response, even when the application correctly catches the fetch() rejection. undici 6.x, 7.x, and 8.x are affected.

Patches

Upgrade to 6.29.1, 7.30.1, or 8.12.2. undici now validates the content-encoding chain before creating the internal body stream and aborts the response when the limit is exceeded, so no error can surface on an orphaned stream.

Workarounds

None.

Credited to hanityx, mcollina, UlisesGascon.

Questions

Does a try/catch around fetch() protect me?

No. The advisory says the process still crashes when the application catches the fetch() rejection, because the error comes from an orphaned internal stream.

Which undici versions fix CVE-2026-109869?

6.29.1, 7.30.1 and 8.12.2. Versions 6.23.0 up to 6.29.1, 7.18.0 up to 7.30.1 and 8.0.0 up to 8.12.2 are affected.

Does the attacker need to be authenticated?

No. They need a server your code fetches from, or a position in the network path. One response is enough.

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