CVE-2026-2229: undici is vulnerable to Unhandled Exception in undici WebSocket Client Due to Invalid server_max_window_bits Validation
Impact
The undici WebSocket client is vulnerable to a denial-of-service attack due to improper validation of the servermaxwindowbits parameter in the permessage-deflate extension. When a WebSocket client connects to a server, it automatically advertises support for permessage-deflate compression. A malicious server can respond with an out-of-range servermaxwindowbits value (outside zlib's valid range of 8-15). When the server subsequently sends a compressed frame, the client attempts to create a zlib InflateRaw instance with the invalid windowBits value, causing a synchronous RangeError exception that is not caught, resulting in immediate process termination.
The vulnerability exists because:
1. The isValidClientWindowBits() function only validates that the value contains ASCII digits, not that it falls within the valid range 8-15 2. The createInflateRaw() call is not wrapped in a try-catch block 3. The resulting exception propagates up through the call stack and crashes the Node.js process
Patches Has the problem been patched? What versions should users upgrade to?
Workarounds Is there a way for users to fix or remediate the vulnerability without upgrading?
Other sources
ImpactThe undici WebSocket client is vulnerable to a denial-of-service attack due to improper validation of the servermaxwindowbits parameter in the permessage-deflate extension. When a WebSocket client connects to a server, it automatically advertises support for permessage-deflate compression. A malicious server can respond with an out-of-range servermaxwindowbits value (outside zlib's valid range of 8-15). When the server subsequently sends a compressed frame, the client attempts to create a zlib InflateRaw instance with the invalid windowBits value, causing a synchronous RangeError exception that is not caught, resulting in immediate process termination.
The vulnerability exists because:
The isValidClientWindowBits() function only validates that the value contains ASCII digits, not that it falls within the valid range 8-15 The createInflateRaw() call is not wrapped in a try-catch block The resulting exception propagates up through the call stack and crashes the Node.js process
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 7.24.0 - Upgrade
Upgrade
npm/undicito a version that resolves this vulnerability.Fixed in 6.24.0
Event History
Frequently Asked Questions
What is the severity of CVE-2026-2229?
CVE-2026-2229 is classified as a high severity vulnerability due to its potential to cause a denial-of-service attack.
How do I fix CVE-2026-2229?
To fix CVE-2026-2229, update the undici library to the latest version where the vulnerability has been addressed.
What types of attacks are possible due to CVE-2026-2229?
CVE-2026-2229 allows for denial-of-service attacks primarily through improper validation of the server_max_window_bits parameter.
Which software is affected by CVE-2026-2229?
CVE-2026-2229 affects the undici library used in Node.js applications.
Is CVE-2026-2229 related to WebSockets?
Yes, CVE-2026-2229 is specifically related to the undici WebSocket client.