mediumAgent ThreatResource Exhaustion

MCP Ruby SDK Session Exhaustion via Unbounded StreamableHTTPTransport Sessions

First seen Jul 30, 2026 · Updated Jul 30, 2026 · CVSS 5.3

mcpruby-sdkdossession-managementstreamable-httpunbounded-memoryASI10 · Rogue AgentsSurface: ProtocolPropagation: None

The official MCP Ruby SDK fails to expire sessions in its StreamableHTTPTransport, allowing an attacker to repeatedly send initialize requests and accumulate ServerSession objects indefinitely. This can exhaust server memory and cause a denial of service against any MCP server built on this SDK. The issue is fixed in version 0.23.0.

Technical Analysis

The StreamableHTTPTransport component in the mcp Ruby gem creates a new ServerSession object on each initialize request but has no default session expiration or eviction policy. An unauthenticated or low-privilege remote client can flood the server with repeated initialize calls, causing unbounded accumulation of session state in memory. This crosses from a single protocol-layer interaction into full server availability impact, since exhausted memory can crash or degrade the MCP server process, disrupting all agents and tools relying on that server. The entry point is the standard MCP HTTP transport initialization handshake, requiring no special privileges beyond network access to the endpoint.

Affected Systems

mcp (Ruby SDK); protocols: MCP

Detection Signatures

  • High rate of repeated 'initialize' requests from a single client or IP within a short window
  • Steadily increasing process memory (RSS) on MCP server hosts correlated with session count
  • Growing number of active ServerSession objects with no corresponding termination/close events
  • Absence of session expiry/eviction log entries over long uptime periods

Remediation Steps

  1. 1

    Upgrade mcp gem

    Update the mcp Ruby gem to version 0.23.0 or later, which introduces session expiration.

  2. 2

    Rate limit initialize requests

    Apply per-client rate limiting or connection throttling on MCP server endpoints to prevent rapid repeated session creation.

  3. 3

    Monitor resource usage

    Add alerting on MCP server memory growth and active session counts to detect exhaustion attempts before crash.

  4. 4

    Enforce session caps

    Configure maximum concurrent session limits and idle timeouts as defense-in-depth even after patching.

CVE / Advisory IDs

CVE-2026-67430

Industries Most Exposed

Software/TechnologySaaS providersany organization deploying MCP-based AI agent infrastructure

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.