Uncaught Exception Affecting undici package, versions >=7.0.0 <7.30.4>=8.0.0 <8.14.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.86% (60th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Uncaught Exception vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-UNDICI-23775819
  • published5 Dec 2026
  • disclosed5 Dec 2026
  • creditDickson Wu

Introduced: 5 Dec 2026

NewCVE-2026-139829  (opens in a new tab)
CWE-248  (opens in a new tab)

How to fix?

Upgrade undici to version 7.30.4, 8.14.1 or higher.

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Uncaught Exception via the stream() API in lib/api/api-stream.js when a Node.js Readable request body is used over HTTP/2. A server that starts a response and then destroys the HTTP/2 session while the upload is still pending causes a single request body error event to reach StreamHandler.onResponseError twice. The second call clears the stored callback, causing the response writable's error handler to invoke runInAsyncScope(null, ...), which throws an uncaught TypeError: Function.prototype.apply was called on null that bypasses the application's callback and error handling entirely, crashing the Node.js process.

Note: This is only exploitable remotely when the application uses stream() with a streaming Readable request body that has not been fully sent when the response starts, and the attacker controls the HTTP/2 server's behavior. request(), Buffer, and generator bodies are not affected by the remote trigger. The same crash can also occur locally over HTTP/1.1 when the application's own request body stream errors after the response has started.

Workaround

Use request() instead of stream() for streaming uploads to untrusted HTTP/2 servers, or send fully buffered request bodies.

CVSS Base Scores

version 4.0
version 3.1