Dec 3, 2026·12 min read·8 visits
Prior to version 0.8.2, websocket-driver uses Buffer.slice() to process incoming WebSocket frames, causing small fragmented frames to hold references to large underlying TCP buffers in memory. Unauthenticated remote clients can send streams of unfinished fragments to trigger severe memory amplification and crash the Node.js server process.
CVE-2026-140000 (also tracked as GHSA-j7r2-xppq-m353) is an uncontrolled resource consumption vulnerability in the faye/websocket-driver-node package prior to version 0.8.2. The StreamReader.read() implementation relies on Buffer.slice() when extracting small segments from incoming network buffers. Because Node.js Buffer slices share underlying memory with their parent ArrayBuffer, small fragmented WebSocket frames retain references to entire 16 KiB to 64 KiB TCP read buffers. An unauthenticated remote attacker can transmit a sequence of incomplete fragmented frames to prevent garbage collection of the parent TCP buffers, causing severe memory inflation and a denial of service via out-of-memory process termination.
The websocket-driver package (faye/websocket-driver-node) is a widely deployed Node.js module that provides a state machine implementation of the WebSocket protocol. Rather than handling raw network sockets directly, the library decouples the protocol parsing logic from the I/O layer, allowing developers to plug in arbitrary stream inputs and outputs. Because it serves as a foundational dependency for higher-level WebSocket servers, frameworks, and command-line tooling in the npm ecosystem, any flaw in its stream ingestion pipeline exposes network-facing Node.js applications to remote attacks.
CVE-2026-140000 (GHSA-j7r2-xppq-m353) is an uncontrolled resource consumption vulnerability (CWE-400) and improper resource throttling flaw (CWE-770) residing in the StreamReader component of websocket-driver. In versions prior to 0.8.2, the StreamReader.prototype.read() method extracts frame headers and payload chunks from queued network buffers using Buffer.prototype.slice(). In the Node.js V8 runtime, slicing a buffer does not allocate new memory or copy bytes; instead, it creates a lightweight view pointing directly to the underlying ArrayBuffer allocated during the initial TCP socket read.
When a WebSocket server receives fragmented messages, it queues the extracted fragment buffers in memory until the final continuation frame arrives or the total message length exceeds the configured maxLength threshold. Because each extracted fragment is a slice of a larger TCP chunk, the V8 garbage collector is blocked from reclaiming the entire parent TCP buffer as long as the small slice remains queued. Although version 0.8.1 introduced a partial mitigation that compacts fragments after 1,000,000 frames, the parser still retains up to 1,000,000 parent TCP input buffers prior to compaction.
An unauthenticated remote attacker can exploit this memory retention behavior over any standard WebSocket endpoint. By transmitting a continuous stream of small, unfinished WebSocket fragment frames across single or multiple TCP packets, the attacker forces the server to retain megabytes or gigabytes of unreferenced TCP read buffers for minuscule payload sizes. This asymmetric memory amplification exhausts the Node.js heap and resident set size (RSS), resulting in application unresponsiveness or abrupt process termination via the operating system out-of-memory (OOM) killer.
The root cause of CVE-2026-140000 lies in the interaction between Node.js buffer memory management semantics and the queue consumption logic inside lib/websocket/driver/stream_reader.js. In Node.js, Buffer instances are views over contiguous memory allocations represented by ArrayBuffer objects. When the Node.js net or tls socket layer reads incoming data from the operating system kernel, it typically allocates buffers ranging from 16 KiB to 64 KiB and passes them to the application layer via data events, which subsequently invoke StreamReader.prototype.put(buffer).
When the WebSocket protocol state machine requests a specific number of bytes to parse a frame header, masking key, or payload fragment, it calls StreamReader.prototype.read(length). In versions prior to 0.8.2, if the first buffer in this._queue (first) is larger than the requested length, StreamReader.prototype.read() executes buffer = first.slice(0, length) to return the requested data, and updates the head of the queue using queue[0] = first.slice(length). Neither operation copies data or frees the consumed portion of the buffer; both slices maintain active pointers to the original backing store.
The retention problem manifests when the protocol parser processes fragmented WebSocket messages (frames where the FIN bit is set to 0 and the opcode indicates a text, binary, or continuation frame). As the Hybi parser reads each fragment payload from StreamReader, it appends the returned slice into an internal array representing the incomplete message. Even after StreamReader finishes traversing the rest of the 64 KiB TCP buffer and shifts it out of this._queue, the single small slice stored in the Hybi fragment array keeps the entire 64 KiB parent ArrayBuffer alive in the V8 heap.
In versions prior to 0.8.1, these fragment slices are held indefinitely until the client sends a frame with FIN=1 or the accumulated byte count of the fragments exceeds maxLength. Since each fragment payload can be as small as 1 byte while anchoring a 64 KiB backing buffer, the actual memory consumed on the host is up to 65,536 times larger than the logical message size tracked against maxLength. Version 0.8.1 attempted to bound this growth by compacting the fragment queue after 1,000,000 fragments, but retaining 1,000,000 distinct TCP buffers still allows an attacker to pin dozens of gigabytes of RAM before compaction occurs.
The vulnerable implementation is located in lib/websocket/driver/stream_reader.js. Prior to version 0.8.2, StreamReader.prototype.read() satisfied read requests either by shifting an exact-match buffer off this._queue, slicing the leading buffer in place, or splicing multiple buffers and concatenating them with a slice of the final trailing buffer.
// Vulnerable code in lib/websocket/driver/stream_reader.js (< 0.8.2)
StreamReader.prototype.read = function(length) {
if (length > this._queueSize) return null;
if (length === 0) return Buffer.alloc(0);
this._queueSize -= length;
var queue = this._queue,
remain = length,
first = queue[0],
buffers, buffer;
if (first.length >= length) {
if (first.length === length) {
return queue.shift();
} else {
// FLAW: first.slice() creates a view referencing first's underlying ArrayBuffer.
// If the caller stores 'buffer' long-term, 'first' cannot be garbage collected.
buffer = first.slice(0, length);
queue[0] = first.slice(length);
return buffer;
}
}
for (var i = 0, n = queue.length; i < n; i++) {
if (remain < queue[i].length) break;
remain -= queue[i].length;
}
buffers = queue.splice(0, i);
if (remain > 0 && queue.length > 0) {
// FLAW: Slicing the remaining buffer also retains references during partial reads.
buffers.push(queue[0].slice(0, remain));
queue[0] = queue[0].slice(remain);
}
return Buffer.concat(buffers, length);
};In commit 93c3c5fc43e40726eaa3c25d13d200f0ec12cfed, author James Coglan refactored StreamReader.prototype.read() to eliminate Buffer.prototype.slice() entirely. Instead of returning a view over the queued TCP buffer, the patched method allocates a dedicated buffer of the exact requested length using Buffer.alloc(length) and delegates byte extraction to a new helper method, StreamReader.prototype._readInto().
// Patched code in lib/websocket/driver/stream_reader.js (0.8.2)
StreamReader.prototype.read = function(length) {
if (length > this._queueSize) return null;
// FIX: Always allocate a standalone buffer of the exact required size.
var output = Buffer.alloc(length);
this._readInto(output);
return output;
};
StreamReader.prototype._readInto = function(output) {
var length = output.length,
remain = length,
dropped = 0,
buffer, n;
for (var i = 0; i < this._queue.length; i++) {
if (remain === 0) break;
buffer = this._queue[i];
// Calculate bytes available in the current queued buffer from current offset
n = Math.min(remain, buffer.length - this._offset);
// FIX: Explicitly copy bytes into the standalone output buffer.
// No reference to 'buffer' is leaked to the caller.
buffer.copy(output, length - remain, this._offset, this._offset + n);
remain -= n;
this._offset += n;
// Track when a queued buffer has been completely consumed
if (this._offset === buffer.length) {
this._offset = 0;
dropped += 1;
}
}
// FIX: Remove fully consumed TCP buffers from the queue so V8 GC can reclaim them.
this._queue.splice(0, dropped);
this._queueSize -= length;
};The fix addresses the vulnerability through three mechanisms. First, Buffer.alloc(length) combined with buffer.copy() ensures that every buffer returned by StreamReader.prototype.read() owns an independent backing store whose size strictly matches the logical read length. Second, the introduction of the this._offset state variable allows StreamReader to track read progress inside the head buffer without repeatedly calling first.slice(length) and mutating this._queue[0]. Third, once this._offset reaches buffer.length, the exhausted TCP buffer is immediately spliced out of this._queue, severing all references and making the underlying network allocation immediately eligible for V8 garbage collection.
> [!NOTE]
> This patch is comprehensive with respect to buffer reference retention in StreamReader. By forcing a value copy at the stream boundary, higher-level protocol handlers (such as the Hybi frame parser) can no longer inadvertently pin network read buffers regardless of how long fragmented messages remain open.
Exploiting CVE-2026-140000 requires no authentication, special privileges, or complex timing conditions. The attacker only needs network access to establish a standard WebSocket handshake with a target server running websocket-driver prior to version 0.8.2. Once the HTTP 101 Switching Protocols upgrade completes, the attacker interacts directly with the StreamReader and frame parser via raw TCP socket writes.
To maximize the memory amplification factor, the attacker crafts a sequence of fragmented WebSocket frames alongside filler traffic designed to cause the target Node.js socket layer to allocate large TCP read buffers. A standard unmasked or masked client-to-server WebSocket fragment header is 2 to 6 bytes long, followed by a 1-byte payload. The first frame uses opcode 0x01 (Text) or 0x02 (Binary) with FIN=0, and subsequent frames use opcode 0x00 (Continuation) with FIN=0.
If an attacker packs thousands of 1-byte fragments into a single 64 KiB TCP segment, all slices extracted from that segment will share the same 64 KiB parent ArrayBuffer, yielding no memory amplification beyond the 64 KiB chunk itself. To achieve maximum amplification, the attacker ensures that each 1-byte fragment resides in a separate large TCP read allocation. The attacker accomplishes this by combining a large complete frame (such as an unfragmented Ping or ignored application message) with a single 1-byte continuation fragment (FIN=0) in each 64 KiB TCP transmission.
When the server processes the 64 KiB TCP chunk, the large complete frame is parsed, dispatched, and discarded. However, the trailing 1-byte continuation fragment is sliced from that same 64 KiB TCP buffer and pushed onto the unfinished fragment array. As a result, transmitting 10,000 such packets requires the attacker to keep only 10,000 bytes of logical fragment payload queued against the server's maxLength limit (which defaults to 64 MiB in websocket-driver), while forcing the Node.js process to retain 10,000 * 64 KiB (approximately 640 MiB) of uncollectable memory in RSS. Scaling this across multiple concurrent WebSocket connections rapidly exhausts system memory and crashes the Node.js process.
CVE-2026-140000 carries a CVSS v3.1 base score of 7.5 (High), defined by the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The Attack Vector is Network (AV:N) and Privileges Required is None (PR:N), reflecting that any remote client capable of completing a WebSocket handshake can trigger the flaw. Attack Complexity is Low (AC:L) and User Interaction is None (UI:N), as the memory retention occurs deterministically during standard WebSocket frame parsing.
The security impact is strictly confined to Availability (A:H), with no direct impact on Confidentiality (C:N) or Integrity (I:N). Because StreamReader.prototype.read() calculates slice boundaries accurately based on available queue length, the bug does not allow out-of-bounds memory reads or uninitialized memory disclosure. Instead, the impact is a denial of service against the Node.js runtime process.
In production Node.js environments, V8 enforces a default heap limit (typically around 1.4 GiB to 4 GiB depending on architecture and Node.js version), while Buffer allocations reside in off-heap C++ memory (tracked under process.memoryUsage().external and arrayBuffers) that contributes directly to the process Resident Set Size (RSS). When an attacker pins thousands of 64 KiB ArrayBuffer instances, the process either hits container cgroup memory limits (such as in Kubernetes pods or Docker containers) and is terminated by the Linux kernel OOM killer, or triggers a fatal Allocation failed - process out of memory abort in V8.
Because Node.js operates on a single-threaded event loop architecture per process, an OOM crash terminates the entire application instance, dropping all active HTTP and WebSocket connections for all connected users simultaneously. As of current threat intelligence telemetry, CVE-2026-140000 is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and holds an EPSS score of 0.00621 (51.14th percentile), with no weaponized public exploit modules observed in the wild.
The definitive remediation for CVE-2026-140000 is to upgrade the websocket-driver package to version 0.8.2 or later. Version 0.8.2 replaces Buffer.prototype.slice() in StreamReader.prototype.read() with explicit buffer allocation and byte copying via Buffer.prototype.copy(), ensuring that queued fragment payloads never hold references to underlying TCP socket read buffers.
Because websocket-driver is frequently installed as a transitive dependency of higher-level packages (such as faye-websocket, faye, or various development servers and RPC frameworks), administrators should verify their full dependency tree and force an update in their package lockfiles:
# Update websocket-driver directly or via npm overrides
npm install websocket-driver@>=0.8.2
# Verify that no vulnerable versions (< 0.8.2) remain in the dependency tree
npm ls websocket-driverIf immediate dependency patching is blocked by deployment freezes, engineering teams can apply defense-in-depth mitigations at the reverse proxy, API gateway, or process management layers. Deploying a WebSocket-aware proxy that reassembles fragmented WebSocket frames before forwarding complete messages to the upstream Node.js server prevents raw fragment streams from reaching websocket-driver. Additionally, enforcing strict per-IP connection limits and aggressive idle/read timeouts on the ingress proxy constrains the rate at which an attacker can hold open fragmented sessions.
At the application and host level, operators should configure process supervisors (such as systemd, PM2, or Kubernetes liveness/memory resource limits) to automatically restart workers if memory consumption crosses abnormal thresholds. Reducing the maxLength option passed to the websocket.driver constructor lowers the absolute ceiling of logical bytes an unfinished fragmented message can accumulate, though it does not completely eliminate the amplification ratio between logical fragment bytes and retained TCP buffers in unpatched versions.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
websocket-driver faye | < 0.8.2 | 0.8.2 |
| Attribute | Detail |
|---|---|
| CVE / GHSA ID | CVE-2026-140000 / GHSA-j7r2-xppq-m353 |
| Affected Component | websocket-driver (faye/websocket-driver-node) < 0.8.2 |
| Weakness Class | CWE-400 (Uncontrolled Resource Consumption) / CWE-770 |
| Attack Vector | Network (Unauthenticated WebSocket Connection) |
| CVSS v3.1 Score | 7.5 HIGH (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| EPSS Score | 0.62% (51.14th Percentile) |
| Impact | Memory Amplification / Out-of-Memory Denial of Service |
| CISA KEV Status | Not Listed |
The product does not properly control the allocation or maintenance of a limited resource, enabling an actor to consume excessive resources.
CVE-2026-141555 (GHSA-vfhw-gfwp-vxfj) is a Cross-Site Scripting (XSS) vulnerability in the Python HTML sanitization library lxml-html-clean prior to version 0.4.7. The vulnerability stems from a parser differential between libxml2 and HTML5 browser parsing engines when handling HTML comments nested within raw-text and escapable raw-text elements (such as <noscript>, <textarea>, <title>, and <iframe>). When the cleaner is instantiated with the non-default configuration comments=False, an attacker can embed a closing tag inside an HTML comment to prematurely terminate the raw-text container in the client browser and execute arbitrary JavaScript.
CVE-2026-141556 (GHSA-5gvf-7wqf-r4cv) is an input sanitization bypass vulnerability resulting in Cross-Site Scripting (XSS) in lxml-html-clean versions through 0.4.6. When the Cleaner class is initialized with safe_attrs_only=False and javascript=True, the link sanitization mechanism relies exclusively on lxml.html.defs.link_attrs via doc.rewrite_links(). Because this attribute list omits the iframe srcdoc attribute and SVG SMIL animation value attributes (to, from, by, values), attackers can inject arbitrary HTML and JavaScript payloads that survive sanitization.
CVE-2026-135390 is an authentication bypass vulnerability in the Pion DTLS Go library caused by improper validation of cached DTLS 1.2 sessions. When an application shares a single SessionStore across both outbound client connections and inbound server listeners, a remote server previously contacted by the application's client can reuse the negotiated session identifier and master secret to authenticate against the application's server listener via abbreviated session resumption, bypassing mutual TLS and Pre-Shared Key checks.
CVE-2026-77132 is an authorization bypass and information disclosure vulnerability in the TYPO3 CMS backend localization wizard (ext:backend). Multiple backend AJAX endpoints failed to validate page-level and record-level access permissions before processing requests. As a result, authenticated backend users with restricted privileges can query these routes directly to enumerate sensitive metadata, record titles, unique identifiers, and layout structures across unauthorized sections of the page tree.
CVE-2026-141554 (GHSA-xhqj-2fcc-8vf7) is an incorrect authorization vulnerability (CWE-863) in AG2 (formerly AutoGen), an open-source AgentOS framework for multi-agent AI systems. In versions from 0.13.3 prior to 1.3.4, the SandboxShellTool component configured with readonly=True and an ignore pattern list fails to prevent recursive search and comparison utilities (grep, egrep, fgrep, and diff) from accessing and disclosing restricted files. Because the command-line security filter only inspects explicit path tokens passed as arguments rather than files discovered autonomously during directory traversal, an AI agent processing untrusted input or prompt injections can be induced to read and expose protected files such as .env configurations, cryptographic keys, and credentials.
Pion DTLS versions from 2.0.0 prior to 3.1.13 and 4.0.0-rc.6 fail to enforce an upper bound on the modulus bit length of peer RSA public keys during handshake signature and certificate chain verification. Because RSA verification performs modular exponentiation whose computational complexity grows superlinearly with modulus size, a remote unauthenticated peer can transmit a synthetic certificate containing an arbitrary multi-thousand-bit RSA modulus and an invalid signature to trigger CPU exhaustion.