# GHSA-MF4Q-95QJ-5V8F: undici vulnerable to Denial of Service via unhandled exception in stream() on request body errors

- Database: GitHub
- Severity: CVSS 7.5 (High)
- Published: 2026-12-04
- Modified: 2026-12-04

## Tracked as

- [CVE-2026-139829](https://cve.now/CVE-2026-139829.md): undici denial of service via uncaught exception in stream API

## Affected versions

- undici (npm): from 7.0.0, fixed in 7.30.4
- undici (npm): from 8.0.0, fixed in 8.14.1

## Description

### Impact

When an application uses the `stream()` API with a Node.js `Readable` request body over HTTP/2, a server that starts a response and then destroys the HTTP/2 session while the upload is still pending can terminate the Node.js process. One request-body `error` event reaches `StreamHandler.onResponseError` twice. The second call clears the stored callback, and the response writable's error handler then calls `runInAsyncScope(null, ...)` (`lib/api/api-stream.js`). That throws an uncaught `TypeError: Function.prototype.apply was called on null`, which the application's callback and error handling never see, and the process exits.

The attacker controls only the HTTP/2 server's behavior. The application must use `stream()` with a streaming request body that has not been fully sent when the response starts. `request()`, Buffer and generator bodies, and HTTP/1.1 socket destruction are not affected by the remote trigger. The same crash occurs without an attacker when the application's own request body stream errors after the response has started, including over HTTP/1.1. The 7.x and 8.x release lines are affected. On 6.x, the HTTP/2 client reports the session error before the request body error, so the remote trigger does not reach this crash; undici 6.29.2 still includes the fix for the application-triggered case.

### Patches

Upgrade to undici `7.30.4` or `8.14.1`.

### Workarounds

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

## References

- https://github.com/nodejs/undici/security/advisories/GHSA-mf4q-95qj-5v8f

Page: https://cve.now/GHSA-MF4Q-95QJ-5V8F

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
