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-67430

CVE-2026-67430: Denial of Service via Unbounded Session Retention in Model Context Protocol Ruby SDK

Alon Barad
Alon Barad
Software Engineer

Jul 31, 2026·8 min read·3 visits

Executive Summary (TL;DR)

Unauthenticated remote attackers can crash stateful MCP Ruby SDK servers by repeatedly triggering new initialize requests. Because the SDK lacks default session limits and idle timeouts, every connection allocates a persistent context in RAM, leading to memory exhaustion and service crashes.

CVE-2026-67430 is a medium-severity Denial of Service (DoS) vulnerability in the Model Context Protocol (MCP) Ruby SDK (packaged as the mcp gem) versions prior to 0.23.0. In stateful deployments using the StreamableHTTPTransport class, client session states are retained in an in-memory hash map. Because the transport implements a nil idle timeout by default, the background scavenger process is suppressed. Remote, unauthenticated attackers can flood the endpoint with initialize requests, rapidly consuming system memory and triggering an Out-of-Memory (OOM) crash.

Vulnerability Overview

The Model Context Protocol (MCP) Ruby SDK, packaged as the mcp gem, implements client-server coordination for context-sharing APIs, often utilized in large language model (LLM) tooling and autonomous agents. Under stateful deployments, the HTTP transport handler MCP::Server::Transports::StreamableHTTPTransport serves as a Rack-compatible application. It is responsible for parsing connection states, validating incoming requests, and coordinating subsequent Server-Sent Events (SSE) channels. To preserve state across distinct HTTP requests, the class creates and stores session metadata in an in-memory hash map, pairing connections to dedicated execution contexts.

Prior to version 0.23.0, the StreamableHTTPTransport class contained an unchecked resource retention vulnerability. During instantiation, the transport allowed client connections to request stateful workspaces without applying any security boundaries to concurrent session counts or individual lifetimes. The default constructor configured the session idle timeout parameter to nil, which prevented the background cleaning process from spawning. This allowed any unauthenticated actor to create persistent connections and exhaust available server resources.

The vulnerability is classified under CWE-770 (Allocation of Resources Without Limits or Throttling) and CWE-401 (Missing Release of Memory after Effective Lifetime). Because the SDK is frequently exposed directly to untrusted networks to enable integration with remote LLM agents, this flaw provides a high-impact attack vector. Successful exploitation permits remote, unauthenticated attackers to trigger process-level exhaustion, terminating the application via the operating system's kernel-level Out-of-Memory (OOM) killer.

Root Cause Analysis

The root cause of CVE-2026-67430 is a logical omission in the constructor and request-handling routine of the MCP::Server::Transports::StreamableHTTPTransport class. When the transport is initialized, the #initialize method accepts an optional parameter named session_idle_timeout. In vulnerable versions (pre-0.23.0), this parameter defaulted to nil. Consequently, when instantiating the transport without explicitly setting a timeout, the class bypassed the execution of #start_reaper_thread, which is responsible for managing background context cleanup.

When an unauthenticated client connects to the transport layer, it initiates a handshake by sending an HTTP POST request to register its capabilities via the initialize method. Upon processing this command, the server executes #handle_initialization, generating a random UUID to track the client session. This newly generated context is stored inside the @sessions hash map. Each ServerSession instance acts as a heap-allocated memory structure containing request tracking arrays, operational parameters, and outbound messaging queues.

Because the server lacked any constraints on the size or growth of the @sessions hash map, the storage mechanism was structurally unbounded. A client could complete the initial handshake, obtain a session identifier via the HTTP response header Mcp-Session-Id, and subsequently drop the underlying TCP connection. The application server, unaware of the client's abrupt disconnection, retains the corresponding ServerSession context in memory indefinitely. Lacking an active background scavenger process, the server's heap memory increases continuously with each subsequent request.

Code-Level Diff & Fix Assessment

A comparative review of the transport source code highlights the missing configuration checks and the remediation steps applied in version 0.23.0. In the vulnerable version, the constructor is defined without secure defaults, permitting the @session_idle_timeout variable to remain unassigned. The patch introduces a structured sentinel object UNSET_IDLE_TIMEOUT to safely determine whether the user intended to bypass timeouts or if they simply relied on safe SDK defaults.

The following code block highlights the vulnerable constructor in the StreamableHTTPTransport class:

# VULNERABLE: Code path from versions < 0.23.0
def initialize(server, stateless: false, enable_json_response: false, session_idle_timeout: nil)
  super(server)
  @sessions = {}
  @mutex = Mutex.new
  @stateless = stateless
  @enable_json_response = enable_json_response
  @session_idle_timeout = session_idle_timeout
  @pending_responses = {}
  # ...
  # If session_idle_timeout is nil (default), the reaper thread never spawns.
  start_reaper_thread if @session_idle_timeout
end

In contrast, the secure implementation in version 0.23.0 sets up a default timeout threshold of 1800 seconds (30 minutes) and establishes a hard upper cap of 10,000 sessions. It also validates inputs and prevents state allocations in stateless environments. The patched constructor implements these limits as follows:

# PATCHED: Code path from version 0.23.0
DEFAULT_SESSION_IDLE_TIMEOUT = 1800
DEFAULT_MAX_SESSIONS = 10_000
 
UNSET_IDLE_TIMEOUT = Object.new.freeze
private_constant :UNSET_IDLE_TIMEOUT
 
def initialize(
  server,
  stateless: false,
  enable_json_response: false,
  session_idle_timeout: UNSET_IDLE_TIMEOUT,
  max_sessions: DEFAULT_MAX_SESSIONS,
  # ...
)
  super(server)
  @sessions = {}
  @mutex = Mutex.new
  @stateless = stateless
  # ...
  # Resolve default timeout safely
  @session_idle_timeout = if session_idle_timeout.equal?(UNSET_IDLE_TIMEOUT)
    stateless ? nil : DEFAULT_SESSION_IDLE_TIMEOUT
  else
    session_idle_timeout
  end
 
  if @session_idle_timeout
    if @stateless
      raise ArgumentError, 'session_idle_timeout is not supported in stateless mode.'
    else
      start_reaper_thread # Proactively spawns background thread by default
    end
  end
 
  @max_sessions = stateless ? nil : max_sessions
end

Furthermore, the patch implements a proactive, inline-scavenging check during request routing. When a new connection arrives and the active session count matches or exceeds @max_sessions, the server scans the map, deletes expired slots synchronously, and updates the state before evaluating if it must drop the incoming request. This prevents immediate denial of service responses when expired sessions can be readily recycled.

Exploitation Methodology & Proof of Concept

Exploitation of CVE-2026-67430 is straightforward and requires no prior authentication or specific network privileges. An attacker only needs network routing to the target TCP port where the stateful MCP server is listening. The exploitation cycle consists of initiating multiple concurrent HTTP POST requests containing a valid JSON-RPC 2.0 initialize command. Because the target does not validate client authenticity before storing session context, every request results in immediate allocation.

To optimize the exploitation flow, the attacking script transmits the initial JSON payload and terminates the TCP socket immediately upon receiving the initial response. By avoiding the subsequent connection steps, such as setting up the SSE stream or executing queries, the attacker minimizes their own client-side memory footprint and connection state. The server, conversely, is forced to maintain the allocated state objects, leading to an asymmetric resource load.

Testing conducted during the vulnerability's initial discovery proved that a single client stream can generate approximately 50,000 sessions in 26.6 seconds. Under this workload, the memory utilization of the host process increases rapidly. Once system RAM limits are exceeded, the kernel invokes the Out-of-Memory killer, abruptly terminating the Ruby application server. This results in complete denial of service for all dependent clients.

Impact Assessment & Attack Surface Analysis

The impact of successful exploitation is a complete Denial of Service (DoS) of the host application, disrupting context exchange for integrated LLM systems and clients. Because the MCP SDK often serves as an inline middleware or wrapper for real-time model interaction pipelines, a service crash halts all active operational queries and blocks future system requests. This can cause wider application failures if parent frameworks fail to handle endpoint unavailability gracefully.

The vulnerability has been evaluated with a CVSS v3.1 score of 5.3 (Medium), reflecting the unauthenticated, remote nature of the exploit balanced against the temporary impact on availability. Because exploitation does not compromise the confidentiality or integrity of host filesystems or execution environments, the base metric ratings remain isolated to the Availability vector. The EPSS score of 0.00291 indicates a low probability of exploitation, but because the MCP SDK is increasingly deployed across internet-facing integrations, the systemic exposure risk is notable.

A detailed review of the attack surface reveals that while the application-level constraints prevent immediate OOM events, secondary risk factors remain. For example, the 503 HTTP status code returned upon reaching the 10,000 session cap is still vulnerable to pool starvation. A slow, distributed attack can cycle requests slowly enough to bypass the 30-minute idle threshold, maintaining the session table at capacity with minimal throughput. Consequently, application availability can be compromised even without crashing the service.

Remediation & Defense-in-Depth Configurations

Remediation of CVE-2026-67430 requires upgrading the mcp gem to version 0.23.0 or later. This release enforces secure-by-default options for stateful configurations, ensuring that timeouts and max session boundaries are actively managed. If immediate upgrades are not feasible, developers must configure explicit parameters on instances of StreamableHTTPTransport to mitigate the unbounded growth of the @sessions variable.

When declaring the transport instance in code, developers should explicitly pass a reasonable idle timeout value and set a conservative limit on the number of concurrent sessions. Passing session_idle_timeout: 900 forces the background reaper thread to spawn and prune inactive contexts every 15 minutes. Additionally, setting a hard session cap using max_sessions stops memory growth from exceeding acceptable bounds. For architectures that do not require state persistence between client requests, setting stateless: true is recommended as it bypasses session allocation entirely.

To establish defensive-in-depth protection, the application server must be placed behind a reverse proxy capable of enforcing rate-limiting at the network layer. This configuration mitigates both application-level OOM vectors and session pool starvation attempts. By restricting the rate of incoming connections from individual IP addresses and imposing maximum request payload limits, the proxy absorbs traffic surges and shields the vulnerable Ruby runtime from direct abuse.

Official Patches

modelcontextprotocolSession Hardening Fix Commit
modelcontextprotocolVersion 0.23.0 Release Tag

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.29%
Top 79% most exploited
1,500
via Shodan

Affected Systems

Model Context Protocol Ruby SDK (mcp gem) running stateful transports

Affected Versions Detail

Product
Affected Versions
Fixed Version
mcp (Ruby SDK)
modelcontextprotocol
>= 0.6.0, < 0.23.00.23.0
AttributeDetail
CWE IDCWE-770
Attack VectorNetwork (AV:N)
CVSS v3.1 Score5.3
EPSS Score0.00291
EPSS Percentile21.41%
ImpactDenial of Service (DoS) via memory exhaustion (OOM)
Exploit StatusPoC Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499.004Endpoint Denial of Service: Application Exhaustion Flood
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The software allocates memory or other resources on behalf of an untrusted actor without placing constraints on the total size or rate of allocations.

Known Exploits & Detection

GitHub Security Advisory GHSA-52jp-gj8w-j6xhProof of Concept demonstrating creation of 50,000 sessions in 26.6 seconds causing server OOM

Vulnerability Timeline

Session leakage patch committed
2026-07-02
Consolidated security fixes released in version 0.23.0
2026-07-07
Vulnerability publicly disclosed and CVE-2026-67430 assigned
2026-07-29

References & Sources

  • [1]GHSA-52jp-gj8w-j6xh: Model Context Protocol Ruby SDK Unbounded Session Retention DoS
  • [2]Core Session Hardening Commit
  • [3]Release Version 0.23.0 Tag
  • [4]CVE-2026-67430 Record
  • [5]NVD Entry for CVE-2026-67430

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 1 hour ago•CVE-2026-63119
6.2

CVE-2026-63119: Denial of Service via Uncontrolled Resource Consumption in Model Context Protocol Ruby SDK

CVE-2026-63119 is a high-impact denial-of-service vulnerability in the Model Context Protocol (MCP) Ruby SDK (distributed as the 'mcp' gem) before version 0.23.0. The vulnerability allows an attacker to cause resource exhaustion and process termination by streaming unbounded input to standard I/O streams.

Alon Barad
Alon Barad
2 views•6 min read
•about 3 hours ago•CVE-2026-67432
7.5

CVE-2026-67432: High Severity Denial of Service in Model Context Protocol (MCP) Ruby SDK

An uncontrolled memory allocation vulnerability (CWE-770) exists in the Model Context Protocol (MCP) Ruby SDK (the `mcp` gem) prior to version 0.23.0. The SDK's StreamableHTTPTransport and StdioTransport layers fail to impose bounds on incoming payloads. An unauthenticated attacker can exploit these issues by transmitting massive, nested payloads to exhaust worker memory, leading to process termination.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 4 hours ago•CVE-2026-67431
8.3

CVE-2026-67431: Session Poisoning via Improper Access Control in Model Context Protocol Ruby SDK

An Improper Access Control vulnerability exists in the Model Context Protocol (MCP) Ruby SDK prior to version 0.23.0. The stateful transport implementation failed to bind established sessions to their original owners or connection contexts, enabling unauthorized actors with access to active session IDs to execute arbitrary tools or alter session state.

Alon Barad
Alon Barad
5 views•7 min read
•about 5 hours ago•CVE-2026-67435
6.0

CVE-2026-67435: Custom Authentication Header Leakage via Cross-Origin Redirects in linuxfabrik-lib

CVE-2026-67435 is a security vulnerability in the linuxfabrik-lib Python library prior to version 6.0.0. When performing HTTP requests with follow_redirects enabled, custom authentication headers (such as X-Auth-Token or X-Api-Key) are forwarded during cross-origin redirects. A malicious or compromised server can leverage this behavior to capture sensitive monitoring and administrative credentials, leading to potential unauthorized access and Server-Side Request Forgery (SSRF).

Amit Schendel
Amit Schendel
6 views•6 min read
•about 6 hours ago•CVE-2026-67429
10.0

CVE-2026-67429: Arbitrary File Write and Path Traversal in Flyto2 Core Modules

CVE-2026-67429 is a critical path traversal vulnerability in Flyto2 Core file-writing modules, including image.download and twelve other modules. By exploiting an insecure validation check that relied on user-controlled parameters, unauthenticated remote attackers can bypass directory confinement and write arbitrary files to the file system, leading to remote code execution.

Alon Barad
Alon Barad
4 views•6 min read
•about 7 hours ago•CVE-2026-67427
8.6

CVE-2026-67427: Host Environment Variable Access Policy Bypass via Template Interpolation in Flyto2 Core

CVE-2026-67427 is a capability bypass vulnerability in the Flyto2 Core workflow execution kernel. Due to a logical inconsistency in how dynamic parameters are resolved, the system evaluates environment variables via template interpolation prior to executing capability filter validation. This permits unprivileged workflow definitions to completely bypass denylist restrictions on the `env.get` module, exfiltrating critical host configurations, API tokens, and credentials via allowed communication channels.

Amit Schendel
Amit Schendel
6 views•5 min read