CVE-2026-18149: undici Denial of Service via Orphaned RetryHandler Response Body
Summary
CVE-2026-18149: undici vulnerable to Denial of Service via orphaned RetryHandler response body. Affects undici across 2 version ranges.
>= 7.11.0, < 7.29.1
>= 8.0.0, < 8.10.2
Fixed in 7.29.1 or 8.10.2, depending on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
undici is a high-performance HTTP/1.1 client designed for Node.js, known for its speed and efficiency in handling HTTP requests. It provides features such as connection pooling, automatic retries, and support for streaming. However, a recent vulnerability has been identified that can lead to denial of service under certain conditions.
Vulnerability Detail
The vulnerability arises from undici's RetryHandler, which can leave a response body pending indefinitely. When a retried request receives a non-retryable response after a truncated one, the original response body remains unsettled. This can cause operations like response.body.text() to hang indefinitely, and the bodyTimeout does not trigger. A malicious server can exploit this behavior by repeatedly sending such responses, leading to an accumulation of unresolved promises and streams, ultimately resulting in a denial of service.
How To Fix
Latest published version: 8.12.3 as of 22 Oct 2026
npm install undici@8.12.3
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
>= 7.11.0, < 7.29.17.29.1npm install undici@7.29.1 -
>= 8.0.0, < 8.10.28.10.2npm install undici@8.10.2
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
As a temporary workaround, impose an independent request deadline and ensure that the response body is destroyed when it expires. This can be implemented in your code as follows:
const response = await undici.request(url);
const bodyTimeout = setTimeout(() => {
response.body.destroy();
}, 5000); // Set timeout to 5 seconds
response.body.text().then(text => {
clearTimeout(bodyTimeout);
// Process text
}).catch(err => {
// Handle error
});
Conclusion
The undici package has a vulnerability (CVE-2026-18149) that can lead to denial of service due to orphaned response bodies in its RetryHandler. It is crucial to update to the patched versions or implement workarounds to mitigate the risk. Regular monitoring with tools like Vulert can help maintain the security of your applications.
See every vulnerability recorded for undici →
FAQ
The CVSS score for this vulnerability is 5.9, indicating a moderate severity level.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application using the Vulert playground at Vulert Scanner without any signup.
Versions of undici starting from 7.11.0 up to 7.29.0 and from 8.0.0 up to 8.10.1 are affected by this vulnerability.
If left unaddressed, this vulnerability can lead to denial of service, where your application may hang or become unresponsive due to unresolved promises and streams.
Yes, you can impose an independent request deadline and destroy the response body when it expires as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for undici.