undici vulnerable to Denial of Service via unhandled error in the dump and retry interceptors
Description
Impact
When a dispatcher is composed with the dump and retry interceptors (interceptors.dump() and interceptors.retry()) and the application discards a response body with the documented body.dump(), a malicious or faulty server can crash the Node.js process. The server announces a larger content-length than it sends, delivers a partial body, and closes the connection. The abort reason is lost on the way to the retry handler, whose default retry function receives undefined and throws while reading it. The throw surfaces as an error event on an internal Client that has no listener, so the process exits. The application try/catch and the promise returned by request() do not catch it. A remote, unauthenticated server can trigger this with a single response. undici 8.10.2 through 8.14.0 and 7.29.1 through 7.30.3 are affected: the bug was introduced by the fix for CVE-2026-84947 (GHSA-2gqq-gqf2-x968). Earlier releases and undici 6.x are not affected.
Patches
Fixed in undici 8.14.1 and 7.30.4. Users on either line should upgrade.
Workarounds
Until upgrading, avoid composing the retry interceptor together with the dump interceptor on dispatchers whose response bodies are discarded, or pass a custom retry function to interceptors.retry() that tolerates a non-object error by returning it instead of reading properties from it.