CVE-2026-2229

undici is vulnerable to Unhandled Exception in undici WebSocket Client Due to Invalid server_max_window_bits Validation

Published Mar 12, 2026 CVSS 3.1 · 7.5 High EPSS 1.0% KEV · Not listed
Description
ImpactThe undici WebSocket client is vulnerable to a denial-of-service attack due to improper validation of the server_max_window_bits 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 server_max_window_bits 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

Analysis

AI-generated

Technical impact

The vulnerability arises when a WebSocket server replies with an invalid server_max_window_bits value outside the zlib‑defined range (8–15). The undici client attempts to create a zlib InflateRaw instance with this out‑of‑range value, causing a synchronous RangeError that is not caught. The exception propagates and terminates the Node.js process, resulting in a denial‑of‑service condition for any application that relies on that client. This bug is a fault in input validation (CWE-1284) that leads to an unhandled exception (CWE-248).

Affected Systems

The undici library, which is the HTTP client used by many Node.js applications, is affected. No specific version range is listed in the advisory, so any version of undici that has not been updated to validate the server_max_window_bits parameter correctly is vulnerable. Users of undici in Node.js projects should assume the risk applies until a patch is applied.

Risk and Exploitability

The CVSS score of 7.5 classifies the bug as high severity. The EPSS score of less than 1% indicates a low predicted exploitation probability at present, and the vulnerability is not listed in the CISA KEV catalog. However, the attack vector is remote: an attacker who controls a WebSocket server can send the crafted extension during the handshake. This requires no special privilege on the client side, so the vulnerability can be exploited from anywhere the client connects to such a server. Given the straightforward exploitation path and the severity, the risk is elevated for exposed services that rely on undici.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the undici library to the latest release that includes validation for server_max_window_bits
  • Verify that the Node.js application no longer crashes when interacting with external WebSocket servers
  • Apply the patch before the next code deployment and monitor the application health for any unexpected crashes

Generated by OpenCVE AI on March 20, 2026 at 16:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-v9p9-hfj2-hcw8 Undici has Unhandled Exception in WebSocket Client Due to Invalid server_max_window_bits Validation
History
Type Values Removed Values Added
First Time appeared Nodejs
Nodejs undici
CPEs cpe:2.3:a:nodejs:undici:*:*:*:*:*:node.js:*:*
Vendors & Products Nodejs
Nodejs undici
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Undici
Undici undici
Vendors & Products Undici
Undici undici
Type Values Removed Values Added
Description ImpactThe undici WebSocket client is vulnerable to a denial-of-service attack due to improper validation of the server_max_window_bits 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 server_max_window_bits 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
Title undici is vulnerable to Unhandled Exception in undici WebSocket Client Due to Invalid server_max_window_bits Validation
Weaknesses CWE-1284
CWE-248
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-1284

    Improper Validation of Specified Quantity in Input

  • CWE-248

    Uncaught Exception

Sources

Status
PUBLISHED
Assigner
openjs
Published
Updated
Sep 14, 2026, 12:04 PM
Reserved
Feb 8, 2026, 5:51 PM
Status
Modified
Published
Mar 12, 2026, 9:16 PM
Modified
Sep 4, 2026, 1:18 PM
Severity
Important
Public date
Mar 12, 2026, 8:27 PM