UTC
Medium

MCP Ruby SDK: Unbounded line buffer in stdio transports leads to memory exhaustion (DoS)

CVE-2026-63119 · GHSA-7683-3w9x-ch42 · published 2026-07-30

Severity
Medium
CVSS score
6.2
Chance of exploitation (EPSS)
0.19%
Fixed in
0.23.0
  • Exploitation Public proof of concept
  • Automatable No
  • Technical impact Partial
  • CISA SSVC
What it is

Denial of service via memory exhaustion. A peer that controls the byte stream delivered to the stdio transport can grow a single Ruby String until the process exhausts available memory. Threat-model caveat (important): In the default stdio deployment, the peer process already holds local execution privileges equal to or greater than the victim: On the server side (StdioTransport#open), the writer to $stdin is the parent process that spawned the server, which already holds Process.kill, environment control, and filesystem access over the child. This direction is a robustness defect rather than a security boundary in typical deployments.

What to do

Upgrade mcp to 0.23.0 or later.

IO#gets accepts a second limit argument. Apply a configurable maximum line length (default suggested: 4 MiB — large enough for any realistic JSON-RPC frame including base64-embedded images) at all three call sites, and treat an over-limit line as a transport error that closes the connection: Apply the same pattern at stdiotransport.rb:76 and client/stdio.rb:228. Expose MAXLINE_BYTES as a constructor option on both transports for callers with legitimate large-frame needs.

Affected
PackageRegistryAffectedFixed in
mcpRubyGems<= 0.22.00.23.0

The impact, patch and workaround text comes from the advisory, shortened (GitHub Advisory Database, CC BY 4.0). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-11-22. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].