
Undici Patches Quadratic Regex DoS in Cache Interceptor
The undici HTTP client for Node.js has released patches for a low-severity denial-of-service vulnerability that allows attackers to exhaust CPU resources via malicious Cache-Control and Vary headers. The flaw, rated 3.7 on the CVSS scale, affects versions 7.29.0 through 7.30.3 and 8.9.0 through 8.14.0 when the RFC 9111 cache interceptor is enabled. It stems from a regular expression in the optional-whitespace trimming helper that backtracks quadratically on long runs of internal whitespace, blocking the Node.js event loop for up to 200 milliseconds at default settings or several seconds if header limits are raised. The issue is resolved in undici 7.30.4 and 8.14.1, which replace the inefficient regex with a linear-time implementation. Default fetch and request paths are unaffected as they use a linear scanner for header trimming.