CVE-2026-140009: ws: Memory exhaustion DoS via unbounded automatic pong responses
ws is an open source WebSocket client and server for Node.js. Prior to 5.2.8, 6.2.7, 7.5.14, and 8.23.0, a malicious WebSocket peer can send Ping frames while stopping reads, causing ws to generate and buffer automatic Pong responses without a pending-response bound. The queued Pong frames can exhaust process memory and terminate the application; disabling autoPong where available or combining rate limiting with heartbeats mitigates the issue. This issue is fixed in versions 5.2.8, 6.2.7, 7.5.14, and 8.23.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/wsto a version that resolves this vulnerability.Fixed in 5.2.8 - Upgrade
Upgrade
npm/wsto a version that resolves this vulnerability.Fixed in 6.2.7 - Upgrade
Upgrade
npm/wsto a version that resolves this vulnerability.Fixed in 7.5.14 - Upgrade
Upgrade
npm/wsto a version that resolves this vulnerability.Fixed in 8.23.0 - Configuration
Disable autoPong where available
ws autoPong = false - Compensating control
Combine rate limiting with heartbeats to mitigate unbounded automatic Pong responses
Event History
Frequently Asked Questions
Which deployments are exposed to this denial-of-service condition?
Applications using ws versions earlier than 5.2.8, 6.2.7, 7.5.14, or 8.23.0 are affected when a malicious WebSocket peer can connect and send Ping frames. The issue can exhaust the Node.js process memory and terminate the application.
What must an attacker do to trigger the issue?
The attacker needs to act as a WebSocket peer and repeatedly send Ping frames while no longer reading the server or client's responses. This causes automatically generated Pong frames to accumulate in the output buffer without a pending-response limit.
What can be done if upgrading is not immediately possible?
Disable automatic Pong handling where that option is available. Otherwise, use rate limiting together with heartbeats to mitigate repeated Ping-based buffering.
Which ws releases contain the fix?
The issue is fixed in ws 5.2.8, 6.2.7, 7.5.14, and 8.23.0.