CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-140015

CVE-2026-140015: Unbounded Memory Exhaustion in Ruby websocket-driver HyBi Protocol Handler

Alon Barad
Alon Barad
Software Engineer

Dec 1, 2026·10 min read·2 visits

Executive Summary (TL;DR)

An unauthenticated remote attacker can trigger an Out-of-Memory (OOM) crash in Ruby servers using websocket-driver (< 0.9.1) by sending a WebSocket close frame followed by a continuous stream of raw TCP data over a half-open connection.

CVE-2026-140015 is a high-severity Denial of Service (DoS) vulnerability affecting the Ruby gem websocket-driver in versions prior to 0.9.1. The flaw resides in the HyBi protocol parser (lib/websocket/driver/hybi.rb), which fails to stop buffering incoming TCP stream data after receiving a WebSocket close control frame. Because TCP supports half-open connections, an unauthenticated remote attacker can transmit a close frame to transition the state machine into a non-consuming shutdown stage, and subsequently stream arbitrary data over the open socket to exhaust server heap memory and crash the host Ruby process.

Vulnerability Overview

The websocket-driver Ruby gem provides a modular implementation of the WebSocket protocol (RFC 6455 / HyBi-13 and legacy drafts) designed around pluggable input and output streams. Rather than managing network sockets directly, the library exposes a state machine API where the hosting application or web server (such as Puma, EventMachine, Thin, or Faye) reads raw bytes from a TCP socket and passes them into the driver via the #parse method. Because it decouples protocol parsing from network I/O, websocket-driver is widely deployed as a core dependency across the Ruby real-time web ecosystem.

In versions prior to 0.9.1, the HyBi protocol handler (WebSocket::Driver::Hybi) contains a resource management flaw classified under CWE-770 (Allocation of Resources Without Limits or Throttling). When a WebSocket connection receives a protocol-level close control frame (opcode 0x8), the driver transitions its internal state machine to the shutdown stage (@stage = 5) and emits a close event. However, the driver fails to release or disable its internal byte stream accumulator (@reader).

Because the underlying TCP transport protocol permits half-open connections, a peer that sends a WebSocket close frame is not strictly prevented at the network layer from continuing to transmit raw TCP segments before the server fully tears down the socket file descriptor. If the hosting server continues piping incoming socket data into driver.parse(chunk) after the close frame is processed, websocket-driver appends every received byte chunk to @reader without ever draining or processing the buffer.

An unauthenticated remote client can exploit this decoupling between WebSocket protocol closure and TCP socket teardown to trigger an unbounded memory allocation loop. By initiating a standard WebSocket connection, transmitting a valid close frame, and immediately flooding the open TCP stream with arbitrary data, an attacker can rapidly exhaust available heap memory in the Ruby VM and force the operating system's Out-of-Memory (OOM) killer to terminate the server process.

Root Cause Analysis

The root cause of CVE-2026-140015 lies in an asymmetric state transition between the frame ingestion buffer (@reader) and the frame decoding state machine (@stage) inside lib/websocket/driver/hybi.rb. The WebSocket::Driver::Hybi class maintains an instance of WebSocket::Driver::StreamReader assigned to @reader, which acts as a dynamic byte queue. Incoming network chunks are pushed into the queue via @reader.put(chunk) and consumed sequentially via @reader.read(n) as the parser steps through frame headers and payloads.

The parsing loop in Hybi#parse relies on @stage to determine how many bytes to extract from @reader during each iteration. Stages 0 through 4 correspond to active protocol decoding states: reading the 1-byte opcode and flags (0), reading the 1-byte mask flag and base payload length (1), reading the 2-byte or 8-byte extended payload length (2), reading the 4-byte masking key (3), and reading the frame payload of @frame.length bytes (4). Each of these branches invokes @reader.read(...), which advances the buffer offset and compacts consumed memory.

When the driver receives a close frame (opcode 0x8) or encounters a fatal protocol error, it executes the private shutdown(code, reason, error) method. In vulnerable versions, shutdown resets @frame and @message to nil, sets @ready_state = 3 (CLOSED), and updates @stage = 5. Crucially, shutdown leaves the @reader object instantiated and referenced.

When subsequent TCP bytes arrive on the socket and the host server passes them to Hybi#parse(chunk), the method unconditionally executes @reader.put(chunk) on the very first line before evaluating @stage. Inside the while buffer loop, the case @stage statement evaluates @stage == 5, falls through to the else branch, sets buffer = nil, and breaks out of the loop. Because no @reader.read call occurs when @stage is 5, @reader.put(chunk) becomes a write-only memory sink that grows linearly with every byte transmitted over the TCP socket.

Code Analysis

Comparing the vulnerable implementation in lib/websocket/driver/hybi.rb against commit a8085fea980c971cad4dea817183c42efd2290c2 illustrates how the state machine failed to guard the buffer ingestion entry point.

In versions prior to 0.9.1, Hybi#parse and Hybi#shutdown were implemented as follows:

# lib/websocket/driver/hybi.rb (Vulnerable Code < 0.9.1)
def parse(chunk)
  # VULNERABILITY: Unconditionally appends incoming bytes to @reader
  # regardless of @stage or @ready_state.
  @reader.put(chunk)
  buffer = true
 
  while buffer
    case @stage
      when 0 then
        buffer = @reader.read(1)
        parse_opcode(buffer.getbyte(0)) if buffer
 
      when 1 then
        buffer = @reader.read(1)
        parse_length(buffer.getbyte(0)) if buffer
 
      when 2 then
        buffer = @reader.read(@frame.length_bytes)
        parse_extended_length(buffer) if buffer
 
      when 3 then
        buffer = @reader.read(4)
        if buffer
          @stage = 4
          @frame.masking_key = buffer
        end
 
      when 4 then
        buffer = @reader.read(@frame.length)
 
        if buffer
          @stage = 0
          emit_frame(buffer)
        end
 
      else
        # When @stage == 5, the loop terminates immediately without
        # calling @reader.read(), leaving the newly added chunk in memory.
        buffer = nil
    end
  end
end
 
def shutdown(code, reason, error = false)
  # @reader is left intact while @stage transitions to 5
  @frame = @message = nil
  @stage = 5
  @extensions.close
 
  frame(reason, :close, code) if @ready_state < 2
  @ready_state = 3
 
  emit(:error, ProtocolError.new(reason)) if error
  emit(:close, CloseEvent.new(code, reason))
end

The official patch in commit a8085fea980c971cad4dea817183c42efd2290c2 resolves this flaw through two coordinated changes across parse and shutdown:

diff --git a/lib/websocket/driver/hybi.rb b/lib/websocket/driver/hybi.rb
index 58b401d..99223c3 100644
--- a/lib/websocket/driver/hybi.rb
+++ b/lib/websocket/driver/hybi.rb
@@ -89,8 +89,11 @@ def add_extension(extension)
       end
 
       def parse(chunk)
+        return unless @reader
+
         @reader.put(chunk)
         buffer = true
+
         while buffer
           case @stage
             when 0 then
@@ -258,7 +261,7 @@ def handshake_response
       end
 
       def shutdown(code, reason, error = false)
-        @frame = @message = nil
+        @reader = @frame = @message = nil
         @stage = 5
         @extensions.close

First, shutdown now de-references @reader alongside @frame and @message (@reader = @frame = @message = nil). This immediately makes any previously unconsumed bytes in the StreamReader eligible for Ruby garbage collection as soon as the connection closes or errors out.

Second, parse(chunk) introduces a precondition guard clause (return unless @reader) before invoking @reader.put(chunk). If shutdown has already executed, any subsequent calls to parse become no-ops that discard incoming chunks immediately. This fix completely eliminates the post-shutdown buffering vector in the HyBi driver. Additionally, because shutdown is also invoked on protocol errors (such as invalid opcodes or reserved bit violations), clearing @reader inside shutdown simultaneously prevents memory accumulation after malformed frame sequences.

Exploitation Methodology

Exploiting CVE-2026-140015 requires no authentication, elevated privileges, or special configuration beyond network access to a server endpoint using websocket-driver (< 0.9.1) that does not immediately force-close the underlying TCP socket descriptor synchronously during the close callback.

An attacker executes the exploit across four distinct phases:

  1. WebSocket Handshake Negotiation: The client opens a TCP connection to the target server and transmits a standard HTTP GET request containing Upgrade: websocket, Connection: Upgrade, Sec-WebSocket-Key, and Sec-WebSocket-Version: 13 headers. The server validates the handshake, initializes a WebSocket::Driver::Hybi instance, and responds with HTTP/1.1 101 Switching Protocols.

  2. Close Frame Transmission: The client constructs and transmits a valid masked WebSocket close control frame. In accordance with RFC 6455, client-to-server frames must have the MASK bit set. A minimal valid close frame consists of 6 bytes: 0x88 (FIN=1, opcode=0x8), 0x80 (MASK=1, payload_len=0), followed by a 4-byte masking key (e.g., 0x00, 0x00, 0x00, 0x00). Alternatively, a 2-byte status code such as 1000 (0x03, 0xe8) can be included in the masked payload.

# Conceptual demonstration of payload sequence sent over a raw TCP socket
require 'socket'
 
sock = TCPSocket.new('target.example.com', 8080)
 
# Step 1: Perform HTTP Upgrade Handshake
handshake = "GET /cable HTTP/1.1\r\n" \
            "Host: target.example.com\r\n" \
            "Upgrade: websocket\r\n" \
            "Connection: Upgrade\r\n" \
            "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n" \
            "Sec-WebSocket-Version: 13\r\n\r\n"
sock.write(handshake)
response = sock.readpartial(1024)
 
# Step 2: Send Masked Close Frame (FIN=1, Opcode=8, Mask=1, Len=2, Code=1000)
close_frame = [0x88, 0x82, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8].pack('C*')
sock.write(close_frame)
 
# Step 3: Flood raw bytes over the still-open client write stream
chunk = "A" * 65_536
loop do
  sock.write(chunk)
end
  1. State Transition Trigger: Upon parsing the 6-to-8 byte close frame, Hybi#emit_frame invokes shutdown(1000, ''). The driver sets @stage = 5, queues a server-to-client close response frame, and emits the :close event. If the server's I/O loop waits for the client to close the TCP connection, waits for asynchronous write buffers to flush, or delays socket descriptor destruction while still reading from the socket, the read half of the server's TCP socket remains active.

  2. Half-Open TCP Stream Flood: The client ignores any incoming close frame from the server, refrains from sending a TCP FIN packet, and continuously writes 64KB blocks of arbitrary data to the socket. Each socket read event on the server feeds the data into driver.parse(chunk), expanding @reader's internal buffer until the Ruby process exhausts system RAM or hits its container cgroup memory limit.

Impact Assessment

CVE-2026-140015 carries a CVSS v3.1 base score of 7.5 (High) with 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-accessible (AV:N), requires low attack complexity (AC:L), demands no authentication or privileges (PR:N), and relies on no user interaction (UI:N). While confidentiality (C:N) and integrity (I:N) are unaffected, the availability impact is high (A:H) because a single attacker-controlled connection can terminate the target worker process.

In typical Ruby application deployment architectures, a single process often multiplexes hundreds or thousands of concurrent WebSocket connections using event loops (such as EventMachine, nio4r, or Falcon/Async) or multi-threaded worker pools (such as Puma or ActionCable). When the @reader buffer inside a single WebSocket::Driver::Hybi instance consumes all available heap space, the entire Ruby VM process terminates via NoMemoryError or an OS-level SIGKILL from the Linux OOM killer.

This process-wide termination immediately drops all active WebSocket sessions and in-flight HTTP requests handled by that worker. By opening multiple concurrent connections and streaming post-close payloads at line rate, an attacker can continuously crash worker processes faster than process supervisors (such as systemd, Kubernetes, or Foreman) can respawn them, resulting in a sustained denial of service across the application.

From a threat intelligence perspective, the vulnerability has an EPSS score of 0.00818 (58.33rd percentile) and is not currently listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) evaluates the flaw as Automatable: Yes with Technical Impact: Partial, reflecting the ease with which an attacker can script the three-step handshake, close frame, and TCP flood sequence.

Remediation & Mitigation

The definitive remediation for CVE-2026-140015 is to upgrade the websocket-driver Ruby gem to version 0.9.1 or later. Version 0.9.1 includes commit a8085fea980c971cad4dea817183c42efd2290c2, which de-references @reader during connection shutdown and ignores any subsequent calls to #parse.

> [!NOTE] > Many Ruby applications do not declare websocket-driver directly in their Gemfile, but instead pull it in as a transitive dependency of faye-websocket, actioncable (Ruby on Rails), or em-websocket. Ensure that Gemfile.lock is updated and audited across all production build artifacts.

To update the dependency using Bundler, update the version constraint in your Gemfile and run bundle update:

# Update websocket-driver in Gemfile.lock to >= 0.9.1
bundle update --conservative websocket-driver
 
# Verify the installed version in Gemfile.lock
grep -A 2 "websocket-driver (" Gemfile.lock

For environments where an immediate gem upgrade cannot be deployed, operators can apply defense-in-depth mitigations at both the application I/O glue layer and the network proxy layer:

  1. Application Socket Teardown: In custom server implementations that interface directly with WebSocket::Driver, ensure that the :close event listener immediately stops reading from the underlying socket descriptor and closes the TCP stream (socket.close_read or socket.close) rather than continuing to pipe socket.read chunks into driver.parse.
  2. Reverse Proxy Timeouts and Quotas: Configure upstream WebSocket proxies (such as Nginx, Envoy, HAProxy, or AWS ALB) to enforce strict connection teardown timeouts upon observing a WebSocket close frame, and apply per-connection rate limits or maximum request body/stream quotas where supported.

Official Patches

Faye (GitHub Advisory)Official GitHub Security Advisory for GHSA-7c6x-34q5-4g2j / CVE-2026-140015
Faye (GitHub Commit)Official patch commit stopping post-close buffer accumulation
Faye (GitHub Release)Release tag for websocket-driver version 0.9.1

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.82%
Top 42% most exploited

Affected Systems

websocket-driver Ruby gem (< 0.9.1)faye/websocket-driver-ruby

Affected Versions Detail

Product
Affected Versions
Fixed Version
websocket-driver
Faye / James Coglan
< 0.9.10.9.1
AttributeDetail
Vulnerability TypeCWE-770: Allocation of Resources Without Limits or Throttling
Affected ComponentWebSocket::Driver::Hybi (lib/websocket/driver/hybi.rb)
Attack VectorNetwork (Unauthenticated WebSocket Close Frame + Half-Open TCP Flood)
CVSS v3.1 Score7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
EPSS Score0.82% (58.33rd Percentile)
Security ImpactRemote Denial of Service via Heap Memory Exhaustion (OOM Crash)
Patched Versionwebsocket-driver 0.9.1
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
T1499.003Application Exhaustion Flood
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The product allocates a resource without imposing any limits on the rate, frequency, or overall size of the allocation, allowing adversaries to consume excessive amounts of finite resources such as process heap memory.

Vulnerability Timeline

Fix commit a8085fea980c971cad4dea817183c42efd2290c2 authored by James Coglan
2026-11-25
Patched version 0.9.1 released (commit aaa7293e76421e1cce72eb168ce4be01819c3417)
2026-11-26
CVE-2026-140015 reserved and published alongside GitHub Advisory GHSA-7c6x-34q5-4g2j
2026-11-30
CISA ADP Vulnrichment assessment completed
2026-12-01

References & Sources

  • [1]GitHub Security Advisory GHSA-7c6x-34q5-4g2j
  • [2]Official Fix Commit (a8085fea980c971cad4dea817183c42efd2290c2)
  • [3]websocket-driver v0.9.1 Release Notes
  • [4]CVE.org Official Record: CVE-2026-140015
  • [5]NVD Vulnerability Detail: CVE-2026-140015
  • [6]CVEListV5 Raw JSON Record for CVE-2026-140015

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-140252
7.1

CVE-2026-140252: Denial of Service via Reference Count Underflow in node-tar UnpackSync

A high-severity denial-of-service vulnerability exists in node-tar versions 7.5.22 prior to 8.0.0 within the synchronous stream extraction implementation (UnpackSync). Due to an asymmetrical reference-counting design between the asynchronous base class Unpack and its synchronous subclass UnpackSync, handling any non-fatal entry error or skipped entry causes the internal pending operation counter to decrement below zero. Because the stream termination logic strictly checks for a counter value equal to zero, the extraction stream enters an unrecoverable state where lifecycle completion events (prefinish, finish, end) are never emitted, permanently blocking downstream stream consumers.

Alon Barad
Alon Barad
4 views•11 min read
•about 3 hours ago•CVE-2026-140014
6.5

CVE-2026-140014: AES-256-GCM Nonce Reuse Across Forked Processes in Rust cookie-rs PrivateJar

CVE-2026-140014 (also tracked as GHSA-8wcq-xq25-7fhm and RUSTSEC-2026-0594) is a cryptographic weakness in the Rust cookie library (cookie-rs). Affected versions use userspace thread-local pseudo-random number generators (rand::thread_rng() or rand::rng()) to generate 96-bit nonces for AES-256-GCM encrypted cookies in PrivateJar. Because these generators buffer entropy in userspace memory, invoking a Unix fork() system call without exec() clones the internal RNG buffer into child processes. When sibling or parent-child processes subsequently seal private cookies on the same thread using a shared key, they emit identical nonces. This nonce reuse under AES-GCM compromises ciphertext confidentiality via keystream XOR recovery and enables arbitrary cookie forgery via polynomial GHASH authentication key recovery.

Alon Barad
Alon Barad
3 views•12 min read
•about 4 hours ago•CVE-2026-140008
8.7

CVE-2026-140008: Algorithmic Complexity Denial of Service in minimatch mergeRows()

An algorithmic complexity vulnerability (CWE-407) in the JavaScript glob-matching package minimatch affects versions 11.0.0 through 11.0.6. The flaw originates in the mergeRows() optimization method in src/index.ts, which repeatedly clones and joins entire pattern arrays across every wildcard segment position. This creates quadratic O(N^2) compilation overhead for patterns containing repeated slash-separated wildcards, blocking the single-threaded Node.js event loop and resulting in an unauthenticated Denial of Service.

Alon Barad
Alon Barad
4 views•11 min read
•about 5 hours ago•GHSA-8R27-MM5G-38WW
7.5

GHSA-8r27-mm5g-38ww: Denial of Service via Negative Archive Member Size in github.com/blakesmith/ar

A denial-of-service vulnerability exists in the Go library github.com/blakesmith/ar across all released versions. The archive header parser fails to validate that the 10-byte decimal size field of an archive member is non-negative. When an application processes a crafted Unix ar archive (such as a .deb package or .rlib archive) containing a negative member size, a subsequent read operation attempts to reslice an internal byte buffer using the negative integer as the upper bound. This triggers an unhandled Go runtime slice bounds out-of-range panic, terminating the calling process.

Alon Barad
Alon Barad
4 views•11 min read
•about 9 hours ago•CVE-2026-137191
7.8

CVE-2026-137191: Arbitrary Code Execution via Unverified Package Manager Bootstrap in Vite+ (vp)

Vite+ (vp) versions 0.2.9 through 1.5.0 contain an integrity verification flaw (CWE-494) in the internal package manager bootstrap mechanism. When initializing in an environment where the pinned pnpm distribution is not cached, the runtime queries the registry specified in the local workspace's .npmrc file and validates the downloaded tarball exclusively against the self-reported integrity digest provided by that same registry. An attacker who supplies a repository with a malicious .npmrc pointing to an attacker-controlled registry can achieve arbitrary code execution when a developer or CI runner invokes basic vp commands.

Alon Barad
Alon Barad
2 views•9 min read
•about 10 hours ago•CVE-2026-137190
7.0

CVE-2026-137190: Shell Command Injection in Vite+ Global CLI via Unvalidated Registry Version String

A local OS command injection and dynamic code evaluation vulnerability (CWE-78 / CWE-95) exists in the Vite+ global command-line interface (vp) across versions 0.3.3 through 1.5.0. When resolving package manager dist-tags such as 'latest' with the '--no-install' flag enabled, Vite+ queries the npm registry defined in the local workspace's '.npmrc' file and returns the raw version string without semantic version validation. Because this unvalidated string is interpolated directly into shell environment export statements evaluated by the user's shell wrapper, an attacker controlling the registry can inject shell metacharacters to achieve arbitrary command execution in the developer's local terminal context.

Alon Barad
Alon Barad
4 views•10 min read