Skip to main content

Python CVE-2026-33946

| EUVDEUVD-2026-16866 HIGH
Session Fixation (CWE-384)
2026-03-27 https://github.com/modelcontextprotocol/ruby-sdk GHSA-qvqr-5cv7-wh35
8.2
CVSS 4.0 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Obtain valid session ID
  2. Exploit
    Connect to SSE stream endpoint
  3. Execution
    Hijack victim's session stream
  4. Impact
    Intercept real-time data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V7 - Session Management Session fixation prevention
Exploitation Conditions

Attacker must obtain a valid session ID from the Ruby SDK's StreamableHTTPTransport implementation (model context protocol). No authentication required to hijack SSE stream once session ID is known. Affects applications using ruby-sdk streamable_http_transport.rb without session-to-user identity binding.

Impact

Real-world exploitation risk is moderate to high for deployments using session-based MCP implementations with sensitive tool responses. Authentication requirements not confirmed from available data, though the attack requires obtaining a valid session identifier through unspecified means (noted as out of scope). A publicly available exploit code exists with full proof-of-concept Python clients demonstrating the attack flow. The vulnerability enables complete interception of confidential data streams once a session ID is compromised, with no detection mechanism for the legitimate user. However, exploitation depends on the attacker first obtaining a valid session ID, which acts as a prerequisite barrier. The absence of CVSS scoring makes automated risk prioritization difficult, but the confirmed POC, patch availability, and potential for data exfiltration indicate this should be prioritized for Ruby SDK deployments handling sensitive information through MCP tool responses.

Exploit ScenarioDerived

Publicly available exploit code exists demonstrating the full attack chain. An attacker first obtains a valid session ID through network interception, application logs, or other reconnaissance methods. While the legitimate user maintains an active SSE stream connection receiving tool call responses, the attacker initiates a second GET request to the MCP server using the stolen session ID. The server's store_stream_for_session method overwrites the victim's stream object with the attacker's connection, silently disconnecting the legitimate user. All subsequent tool responses, notifications, and potentially sensitive data flow exclusively to the attacker's stream while the victim receives no indication of compromise beyond loss of data.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 27, 2026

Session hijacking in the Model Context Protocol Ruby SDK (mcp gem) allows attackers to intercept Server-Sent Events streams by reusing valid session identifiers. The streamable_http_transport.rb implementation overwrites existing SSE stream objects when a duplicate session ID connects, silently disconnecting legitimate users and redirecting all tool responses and real-time data to the attacker. A proof-of-concept demonstration has been provided showing successful stream hijacking, where the attacker receives confidential tool call responses intended for the victim. Patch available per vendor advisory (release v0.9.2 per references).

RemediationAI

Upgrade the Model Context Protocol Ruby SDK to version 0.9.2 or later per the vendor release at https://github.com/modelcontextprotocol/ruby-sdk/releases/tag/v0.9.2 and commit https://github.com/modelcontextprotocol/ruby-sdk/commit/db40143402d65b4fb6923cec42d2d72cb89b3874. For environments where immediate patching is not feasible, implement additional controls such as binding session IDs to authenticated user contexts at the application layer, enforcing short session timeouts, and monitoring for duplicate session connection attempts. Consider implementing similar duplicate connection rejection logic as demonstrated in the Python SDK reference implementation at https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py#L680-L685. Review application logs for suspicious patterns of rapid session ID reuse or concurrent connections with identical session identifiers.

Affected VersionsENISA

ruby-sdk < 0.9.2

Affected Packages

rubygems mcp fix: 0.9.2
euvd ruby_sdk fix: 0.9.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in rubygems, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability affects the Model Context Protocol Ruby SDK (pkg:rubygems/mcp), specifically the StreamableHTTPTransport class responsible for managing Server-Sent Events connections. The root cause is CWE-384 (Session Fixation), where the implementation stores only one SSE stream object per session ID without binding sessions to user identities or validating ownership during connection establishment. When store_stream_for_session is invoked with an existing session ID, the code unconditionally overwrites the existing stream object at line 336-339 of streamable_http_transport.rb. This differs from the Python SDK implementation, which returns HTTP 409 Conflict for duplicate connection attempts. The MCP specification recommends binding session IDs to user-specific information, but only 2 of 10 official MCP SDKs (C

and Go) implement this control. The Ruby SDK lacks both user binding and duplicate connection rejection mechanisms.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 8.2 HIGH
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch released
Mar 27, 2026 - 19:00 nvd
Patch available
CVE Published
Mar 27, 2026 - 18:36 nvd
HIGH 8.2

DescriptionGitHub Advisory

Summary

The Ruby SDK's streamable_http_transport.rb implementation contains a session hijacking vulnerability. An attacker who obtains a valid session ID can completely hijack the victim's Server-Sent Events (SSE) stream and intercept all real-time data.

Details

Root Cause The StreamableHTTPTransport implementation stores only one SSE stream object per session ID and lacks:

  • Session-to-user identity binding
  • Ownership validation when establishing SSE connections
  • Protection against multiple simultaneous connections to the same session

PoC

Vulnerable Code

File: streamable_http_transport.rb - L336-L339:

def store_stream_for_session(session_id, stream)
  @mutex.synchronize do
    if @sessions[session_id]
      @sessions[session_id][:stream] = stream
# OVERWRITES existing stream
    else
      stream.close
    end
  end
end
Attack Scenario

Step 1: Legitimate Session Establishment

POST / (initialize) → receives session_id: "abc123"
GET / with Mcp-Session-Id: abc123 → SSE stream connected

Step 2: Session ID Compromise

  • An attacker obtains the session ID through various means (out of scope for this analysis)

Step 3: Stream Hijacking

GET / with Mcp-Session-Id: abc123
@sessions["abc123"][:stream] = attacker_stream `
# Victim's stream is REPLACED (silently disconnected)

Step 4: Data Interception

  • ALL subsequent tool responses/notifications go to the attacker
  • The legitimate user receives no data and has no indication of the hijacking
Technical Details

The vulnerability happens:

Client 1 connects (GET request)

proc do |stream1|
# ← Rack server provides stream1 for client 1
 @sessions[session_id][:stream] = stream1
# Stored
end

Client 2 connects with SAME session ID (Attack!)

proc do |stream2|
# ← Rack provides stream2 for client 2
 @sessions[session_id][:stream] = stream2
# REPLACES stream1!
end

Now when the server sends notifications:

@sessions[session_id][:stream].write(data)
# Goes to stream2 (attacker!)
# stream1 (victim) receives nothing

Comparison: Python SDK Protection

The Python SDK prevents this vulnerability by rejecting duplicate SSE connections:

Refer: https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py#L680-L685

if GET_STREAM_KEY in self._request_streams:
# pragma: no cover
            response = self._create_error_response(
                "Conflict: Only one SSE stream is allowed per session",
                HTTPStatus.CONFLICT,
            )

When a duplicate connection attempt is detected, the Python SDK returns an HTTP 409 Conflict error, protecting the existing connection.

Recommended Mitigations For SDK Maintainers

  • Implement User Binding: All SDKs should bind session IDs to authenticated user identities where possible. Currently only, go-sdk and csharp-sdk do user binding.
  • Ruby SDK: Prevent Duplicate Connections: Implement checks to reject or handle multiple simultaneous connections to the same session
  • Improve Documentation: Provide clear guidance on secure session management implementation for SDK consumers

Steps To Reproduce:

Please find attached two python client files demonstrating the attack

Terminal 1: 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

Terminal 2:

python3 legitimate_client_ruby_server.py

What happens:

  • The client connects and prints the session ID
  • Press Enter to start the SSE stream
  • Notifications start appearing every 3 seconds as the client makes a tool call

Terminal 3 (while the legitimate client is running):

python3 attacker_client_ruby_server.py <SESSION_ID>

Replace <SESSION_ID> with the ID from Terminal 2.

What happens immediately:

  • Terminal 2 (Legitimate): Stops receiving notifications, shows disconnect message
  • Terminal 3 (Attacker): Starts receiving ALL the tool call responses

Impact

While the absence of user binding may not pose immediate risks if session IDs are not used to store sensitive data or state, the fundamental purpose of session IDs is to maintain stateful connections. If the SDK or its consumers utilize session IDs for sensitive operations without proper user binding controls, this creates a potential security vulnerability. For example: In the case of the Ruby SDK, the attacker was able to hijack the stream and receive all the tool responses belonging to the victim. The tool responses can be sensitive confidential data.

Additional Details

Session Hijacking Protection in MCP Implementations

The MCP specification recommends - "MCP servers SHOULD bind session IDs to user-specific information".

Current Implementation Status Across SDKs

Of the 10 official MCP SDKs, only the following implementations bind session IDs to user-specific information:

  1. csharp-sdk - https://github.com/modelcontextprotocol/csharp-sdk/blob/main/src/ModelContextProtocol.AspNetCore/SseHandler.cs#L93-L97
  2. Go-sdk - https://github.com/modelcontextprotocol/go-sdk/blob/main/mcp/streamable.go#L281C1-L288C2

attacker_client_ruby_server.py legitimate_client_ruby_server.py The remaining SDKs do not implement session-to-user binding. Most implementations only verify that a session ID exists, without validating ownership. Additionally, SDK documentation does not provide clear guidance on implementing secure session management, leaving security responsibilities unclear for SDK consumers.

Executive ViewAI

Why It Matters

The Model Context Protocol Ruby SDK (mcp gem) contains a session hijacking vulnerability that allows attackers to intercept and redirect real-time data streams and tool responses to unauthorized recipients. Organizations using this SDK in production environments face exposure of confidential information and loss of control over critical application interactions, requiring immediate patching to prevent data exfiltration.

Business Impact: High
Compensating Controls

Apply vendor patch (mcp gem v0.9.2 or later). If immediate patching is not feasible: disable Server-Sent Events streams or streamable_http_transport functionality until patch is applied; implement network-level access controls restricting mcp SDK connections to trusted internal networks only; monitor for duplicate or anomalous session identifier activity in application logs.

Threat Intelligence Overview

EPSS Score
0.0%
Top 85% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

41
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +41
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy