CVE-2026-67431: MCP Ruby SDK Ruby SSE Session Poisoning Vulnerability

HIGH
Advisory Identifier: GHSA-5p9g-j988-pcwv
CWE-284
Published
Advisory Summary

CVE-2026-67431 is a HIGH ruby sse session poisoning vulnerability (CWE-284: Improper Access Control) affecting MCP Ruby SDK libraries in the RubyGems ecosystem. The issue involves ruby sse session poisoning. Remediation is available by upgrading affected packages to version 0.23.0.

CVE-2026-67431 at a Glance

CVE Identifier CVE-2026-67431
GHSA Identifier GHSA-5p9g-j988-pcwv
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-284: Improper Access Control
Affected Product MCP Ruby SDK
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-67431

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-67431, 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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 **Vulnerability**: Missing Session Ownership Validation in the Ruby MCP SDK's Streamable and SSE HTTP transport implementation. Any attacker with a stolen session ID can execute tools with the victim's session. This is a silent attack - the victim's session is compromised and being used for unauthorized actions, but it is hard to know for the victim ### Details https://github.com/modelcontextprotocol/ruby-sdk/blob/main/lib/mcp/server/transports/streamable_http_transport.rb#L260-L278 **Victim** starts a legitimate MCP session and receives session ID abc-123 **Attacker** obtains the session ID (various means - network sniffing, logs, etc. out of scope for this analysis) **Attacker** sends POST to /messages/abc-123 with a tool call **Server** accepts the request (no ownership validation!) **Server** executes the tool and sends response to victim's SSE stream **Victim** receives attacker's response, thinking it's legitimate ### PoC [attacker_client.py](https://github.com/user-attachments/files/26044817/attacker_client.py) [legitimate_client.py](https://github.com/user-attachments/files/26044818/legitimate_client.py) **Prerequisites** 1. Python 3.8+ 2. Install dependencies: `requests` **Running the Demo** 1. **Terminal 1:** Start the Ruby MCP Server `ruby streamable_http_server.rb` Makes use of https://github.com/modelcontextprotocol/ruby-sdk/blob/main/examples/streamable_http_server.rb This server has a tool call notification_tool which the clients call 2. **Terminal 2:** Start Victim Client `python3 legitimate_client.py` 3. **Terminal 3** - Attacker Client: Copy the session ID from Terminal 1 and run: ```bash python3 attacker_client.py abc-123-def-456 ``` 4. **Back to Terminal 2** - Victim sees the injected response: ### Impact - **Integrity:** HIGH - Attacker can execute unauthorized tools and modify state - **Availability:** LOW - Attacker can disrupt victim's session with injected responses ### Additional Details Session Hijacking Protection in MCP Implementations The MCP specification recommends - "[MCP servers SHOULD bind session IDs to user-specific information](https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices#mitigation-4)". #### User Binding - Comparison other SDKs **csharp-sdk** - https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L36 - https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L95-L98 **Go-sdk** - https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L66 - https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L316-L320 #### Comparison with the Stream Replacement vulnerability **Stream Replacement** https://github.com/modelcontextprotocol/ruby-sdk/security/advisories/GHSA-qvqr-5cv7-wh35 - **Target**: SSE stream connection - **Attack Vector**: GET /mcp - **What happens to Victim**: The connection is disconnected and doesn't receive reponses **Session Poisoning** - **Target**: Tool execution - **Attack Vector**: POST /mcp - **What happens to Victim**: The connection stays connected and receives responses of tool calls by attacker

CVE-2026-67431 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-67431?
CVE-2026-67431 is a security vulnerability in MCP Ruby SDK involving Ruby SSE Session Poisoning under CWE-284: Improper Access Control.
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-67431?
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 CWE is associated with CVE-2026-67431?
CVE-2026-67431 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check RubyGems dependencies for CVE-2026-67431?
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-5p9g-j988-pcwv",
  "modified" : "2026-07-30T14:44:28Z",
  "published" : "2026-07-30T14:44:28Z",
  "aliases" : [ "CVE-2026-67431" ],
  "summary" : "MCP Ruby SDK: Ruby SSE Session Poisoning",
  "details" : "### Summary\n**Vulnerability**: Missing Session Ownership Validation in the Ruby MCP SDK's Streamable and SSE HTTP transport implementation. Any attacker with a stolen session ID can execute tools with the victim's session. This is a silent attack - the victim's session is compromised and being used for unauthorized actions, but it is hard to know for the victim\n\n### Details\nhttps://github.com/modelcontextprotocol/ruby-sdk/blob/main/lib/mcp/server/transports/streamable_http_transport.rb#L260-L278\n\n**Victim** starts a legitimate MCP session and receives session ID abc-123\n**Attacker** obtains the session ID (various means - network sniffing, logs, etc. out of scope for this analysis)\n**Attacker** sends POST to /messages/abc-123 with a tool call\n**Server** accepts the request (no ownership validation!)\n**Server** executes the tool and sends response to victim's SSE stream\n**Victim** receives attacker's response, thinking it's legitimate\n\n### PoC\n[attacker_client.py](https://github.com/user-attachments/files/26044817/attacker_client.py)\n[legitimate_client.py](https://github.com/user-attachments/files/26044818/legitimate_client.py)\n\n**Prerequisites**\n\n1. Python 3.8+\n2. Install dependencies: `requests`\n\n**Running the Demo**\n\n1. **Terminal 1:** Start the Ruby MCP Server\n\n`ruby streamable_http_server.rb`\n\nMakes use of https://github.com/modelcontextprotocol/ruby-sdk/blob/main/examples/streamable_http_server.rb\nThis server has a tool call notification_tool which the clients call\n\n2. **Terminal 2:**  Start Victim Client\n\n`python3 legitimate_client.py`\n\n3.  **Terminal 3** - Attacker Client:\n\nCopy the session ID from Terminal 1 and run:\n\n```bash\npython3 attacker_client.py abc-123-def-456\n```\n4. **Back to Terminal 2** - Victim sees the injected response:\n\n### Impact\n\n- **Integrity:** HIGH - Attacker can execute unauthorized tools and modify state\n- **Availability:** LOW - Attacker can disrupt victim's session with injected responses\n\n### Additional Details\nSession Hijacking Protection in MCP Implementations\n\nThe MCP specification recommends - \"[MCP servers SHOULD bind session IDs to user-specific information](https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices#mitigation-4)\".\n\n#### User Binding - Comparison other SDKs\n**csharp-sdk**\n\n- https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L36\n- https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L95-L98\n\n**Go-sdk**\n\n- https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L66\n- https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L316-L320\n\n#### Comparison with the Stream Replacement vulnerability \n\n**Stream Replacement**\nhttps://github.com/modelcontextprotocol/ruby-sdk/security/advisories/GHSA-qvqr-5cv7-wh35\n\n- **Target**: SSE stream connection\n- **Attack Vector**: GET /mcp\n- **What happens to Victim**: The connection is disconnected and doesn't receive reponses \n\n**Session Poisoning**\n\n- **Target**: Tool execution\n- **Attack Vector**: POST /mcp\n- **What happens to Victim**: The connection stays connected and receives responses of tool calls by attacker",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N"
  } ],
  "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-5p9g-j988-pcwv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-67431"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/ruby-sdk/commit/35466605319a34e4c7808712ae9bb1ca1afb2356"
  }, {
    "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-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-30T14:44:28Z",
    "nvd_published_at" : "2026-07-29T20:17:12Z"
  }
}