# GHSA-GC94-VJFP-FM7X: undici vulnerable to Denial of Service via quadratic Cache-Control and Vary header parsing

- Database: GitHub
- Severity: CVSS 3.7 (Low)
- Published: 2026-12-04
- Modified: 2026-12-04

## Tracked as

- [CVE-2026-132045](https://cve.now/CVE-2026-132045.md): undici denial of service in Cache-Control header parsing

## Affected versions

- undici (npm): from 7.29.0, fixed in 7.30.4
- undici (npm): from 8.9.0, fixed in 8.14.1

## Description

### Impact

When the RFC 9111 cache interceptor (`undici.interceptors.cache()`) is in use, undici parses the server's `Cache-Control` and `Vary` response headers with an optional-whitespace trim helper (`trimOWS`) whose regular expression `/^[\t ]+|[\t ]+$/g` backtracks quadratically. A malicious or compromised origin that returns a header value with a long run of internal whitespace forces the client to spend O(N^2) CPU parsing a single, size-bounded response, synchronously blocking the Node.js event loop. The attacker sends roughly N bytes and the victim spends roughly N^2 time. At the default `maxHeaderSize` (16 KiB) one such response stalls the event loop for around 100 to 200 ms; applications that raise `maxHeaderSize` reach multi-second stalls, and concurrent responses serialize. The default `fetch()` and request path is not affected, because it trims response headers with a linear scanner. Only the cache interceptor's header parsing uses the vulnerable helper.

### Patches

Fixed in undici 7.30.4 and 8.14.1. The optional-whitespace trimming now runs in linear time.

### Workarounds

Do not compose the cache interceptor (`undici.interceptors.cache()`). The default request and `fetch()` paths are unaffected.

## References

- https://github.com/nodejs/undici/security/advisories/GHSA-gc94-vjfp-fm7x

Page: https://cve.now/GHSA-GC94-VJFP-FM7X

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