Monitor vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
5.9
Undici: Large Responses Can Cause Server to Run Out of Memory
CVE-2026-2581
GHSA-phc3-fgpg-7m6h
Summary
Some versions of the Undici library can consume too much memory when handling large responses, potentially causing the server to crash. This affects applications that use Undici with endpoints that return large data. To fix this, update to a patched version of Undici and Node.js if necessary.
What to do
- Update undici to version 7.24.0.
Affected software
| Vendor | Product | Affected versions | Fix available |
|---|---|---|---|
| – | undici | > 7.17.0 , <= 7.24.0 | 7.24.0 |
Original title
Undici has Unbounded Memory Consumption in its DeduplicationHandler via Response Buffering that leads to DoS
Original description
## Impact
This is an uncontrolled resource consumption vulnerability (CWE-400) that can lead to Denial of Service (DoS).
In vulnerable Undici versions, when `interceptors.deduplicate()` is enabled, response data for deduplicated requests could be accumulated in memory for downstream handlers. An attacker-controlled or untrusted upstream endpoint can exploit this with large/chunked responses and concurrent identical requests, causing high memory usage and potential OOM process termination.
Impacted users are applications that use Undici’s deduplication interceptor against endpoints that may produce large or long-lived response bodies.
## Patches
The issue has been patched by changing deduplication behavior to stream response chunks to downstream handlers as they arrive (instead of full-body accumulation), and by preventing late deduplication when body streaming has already started.
Users should upgrade to the first official Undici (and Node.js, where applicable) releases that include this patch.
## Workarounds
If upgrading immediately is not possible:
- Disable `interceptors.deduplicate()` for affected clients/routes.
- Use `skipHeaderNames` with a marker header to force high-risk requests to bypass deduplication.
- Avoid concurrent identical requests to untrusted endpoints that may return very large/chunked bodies.
- Apply upstream/proxy response-size and timeout limits.
This is an uncontrolled resource consumption vulnerability (CWE-400) that can lead to Denial of Service (DoS).
In vulnerable Undici versions, when `interceptors.deduplicate()` is enabled, response data for deduplicated requests could be accumulated in memory for downstream handlers. An attacker-controlled or untrusted upstream endpoint can exploit this with large/chunked responses and concurrent identical requests, causing high memory usage and potential OOM process termination.
Impacted users are applications that use Undici’s deduplication interceptor against endpoints that may produce large or long-lived response bodies.
## Patches
The issue has been patched by changing deduplication behavior to stream response chunks to downstream handlers as they arrive (instead of full-body accumulation), and by preventing late deduplication when body streaming has already started.
Users should upgrade to the first official Undici (and Node.js, where applicable) releases that include this patch.
## Workarounds
If upgrading immediately is not possible:
- Disable `interceptors.deduplicate()` for affected clients/routes.
- Use `skipHeaderNames` with a marker header to force high-risk requests to bypass deduplication.
- Avoid concurrent identical requests to untrusted endpoints that may return very large/chunked bodies.
- Apply upstream/proxy response-size and timeout limits.
nvd CVSS3.1
5.9
Vulnerability type
CWE-770
Allocation of Resources Without Limits
Published: 13 Mar 2026 · Updated: 14 Mar 2026 · First seen: 12 Mar 2026