/

CVE-2026-52869

Severity:

HIGH RISK

(7.1)

Session Fixation (CWE-639) in MCP Python HTTP Transports

CVE-2026-52869

Analyzed

Vulnerability type

Category:

Session Fixation / Broken Access Control

CWE:

CWE-639

Impact:

Cross-Session Request Injection / Session Hijacking

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The MCP Python SDK's SSE and stateful Streamable HTTP transports route requests to sessions using only a session identifier, without binding the session to the authenticated principal that created it.

When a bearer-token-authenticated client knows another client's session ID, it can inject JSON-RPC messages into that session, potentially hijacking or manipulating ongoing protocol interactions in multi-client environments.

Affected context

This vulnerability appears in deployments using the MCP Python SDK's SSE (SseServerTransport) or stateful Streamable HTTP (StreamableHTTPSessionManager) transports to manage long-lived JSON-RPC sessions.

It is relevant where multiple authenticated clients can interact with the same MCP server and session identifiers may be discoverable or guessable (e.g., logs, URLs, or shared debugging tools).

The risk materializes when session routing relies solely on session_id query parameters or Mcp-Session-Id headers without validating that the request's authenticated principal matches the principal that originally established the session.

Exploit preconditions

  • Attack surface: MCP server endpoints using SSE or stateful Streamable HTTP transports.
  • Required access: Valid bearer-token authentication to the MCP server and knowledge of a target session_id or Mcp-Session-Id.
  • Trigger point: Sending JSON-RPC requests referencing the victim's session identifier via query parameter or header.
  • Why exploitation is possible: Session association is based only on the session identifier; there is no enforcement that the caller's authenticated identity matches the identity bound to the session at creation time, enabling cross-tenant or cross-user session message injection.

Why this happens

The underlying bug aligns with CWE-639: Authorization Bypass Through User-Controlled Key, where access control for a resource is implemented solely via a user-provided identifier.

In this case, session_id and Mcp-Session-Id function as keys for routing JSON-RPC messages to stateful sessions, but the transport layer fails to cross-check those identifiers against the authenticated principal associated with the session.

This insecure pattern treats the session identifier as sufficient proof of entitlement, rather than as an internal routing token that must always be validated against the caller's identity.

Potential impact

  • An attacker may inject arbitrary JSON-RPC messages into another client's active MCP session.
  • An attacker could manipulate tools, resources, or operations invoked within the victim's session context.
  • An attacker may cause data leakage by triggering responses intended for the victim session.
  • An attacker could disrupt or corrupt session state, leading to denial of service or misleading results for the victim.

General mitigation guidance

Effective mitigation focuses on strengthening session-to-principal binding and removing trust in client-controlled identifiers as sole access keys.

Recommended design patterns include:

  • Binding each server-side session to the authenticated principal at creation and verifying that every subsequent request's identity matches this principal before routing.
  • Treating session identifiers as opaque routing tokens, never as authorization proofs; always perform a separate authorization check.
  • Segmenting sessions by tenant or user and ensuring that cross-tenant access via shared identifiers is impossible.
  • Reducing exposure of session identifiers by avoiding their presence in logs, URLs, or user-visible debug tooling where feasible.
  • Applying least-privilege principles to session capabilities so that even if a session is misrouted, the scope of operations is constrained.

How teams detect issues like this

To detect similar authorization bypasses, organizations can:

  • Use static analysis or code scanning rules to identify patterns where access decisions depend solely on user-supplied identifiers (e.g., session_id, user_id, accountId) without identity checks.
  • Incorporate security-focused code review checklists that flag session routing logic for missing principal verification or missing tenant scoping.
  • Implement runtime auditing of session management operations, logging authenticated principal, session ID, and authorization decisions, then monitor for anomalous cross-user session usage.
  • Employ automated policy enforcement tools that require explicit identity binding for session and stateful transport components across services.

Sources

SourceLink
github.comgithub.com/modelcontextprotocol/python-sdk/commit/1abcca2408a6b50e10ec601181f63f9978705c00
github.comgithub.com/modelcontextprotocol/python-sdk/commit/ce267b6fc515dc4efc1dc70b6975b16ff0feef0a
github.comgithub.com/modelcontextprotocol/python-sdk/pull/2690
github.comgithub.com/modelcontextprotocol/python-sdk/pull/2719
github.comgithub.com/modelcontextprotocol/python-sdk/releases/tag/v1.27.2
github.comgithub.com/modelcontextprotocol/python-sdk/security/advisories/GHSA-jpw9-pfvf-9f58

Frequently asked

questions

Exploitability depends on whether multiple authenticated clients use the same MCP server and whether attackers can learn or predict valid session IDs. In single-client or tightly isolated deployments, practical risk is lower; in shared or multi-tenant deployments, the impact can be significant.

An attacker needs valid bearer-token authentication to the MCP server and knowledge of another user's active session identifier. Without both, they cannot inject messages into another session.

The most robust fix is to bind each session to the authenticated principal at creation and verify that every subsequent request's authentication context matches this principal before routing. Session identifiers should be treated purely as internal routing tokens, with authorization enforced independently.

Adopt a consistent design rule that no resource or session is accessed solely based on a client-controlled identifier. Require explicit identity and tenant validation in session and routing code, enforce these rules via code review and automated checks, and minimize exposure of identifiers that can be used as keys in access-control decisions.

Find out what's already
exploitable in your codebase.