VAITP Dataset

← Back to the dataset

CVE-2026-116685

Open redirect allowing credential header and body leakage across origins.

  • CVSS 5.9
  • CWE-200
  • Authentication, Authorization, and Session Management
  • Remote

The Model Context Protocol Python SDK is the official Python SDK for Model Context Protocol servers and clients. From 1.8.0 until 1.30.0 and 2.2.0, streamable_http_client, streamablehttp_client, sse_client, ClientSessionGroup, OAuth, and create_mcp_http_client client paths enable follow_redirects and follow redirects to a different origin, forwarding caller-supplied custom credential headers and, for 307 or 308 responses, the request body. An attacker who can influence a trusted endpoint's redirect destination can receive that material. This issue is fixed in versions 1.30.0 and 2.2.0.

CVSS base score
5.9
Published
2026-10-27
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Incorrect Interface
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Remote
Impact
Information Disclosure
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade the SDK to version 1.30.0 (or any later 1.x release) or to version 2.2.0 (or any later 2.x release).

Vulnerable code sample

from mcp_sdk import create_mcp_http_client

def fetch_resource(token: str, url: str) -> bytes:
    # VULNERABLE: follows redirects to arbitrary origins with auth header
    client = create_mcp_http_client(
        base_url=url,
        follow_redirects=True,  # insecure
        default_headers={"Authorization": f"Bearer {token}"}
    )
    response = client.get("/")
    response.raise_for_status()
    return response.content

Patched code sample

from mcp_sdk import create_mcp_http_client

def fetch_resource(token: str, url: str) -> bytes:
    # FIX: disable automatic redirects to prevent credential leakage
    client = create_mcp_http_client(
        base_url=url,
        follow_redirects=False,
        default_headers={"Authorization": f"Bearer {token}"}
    )
    response = client.get("/")
    # manually handle redirect if needed without forwarding auth header
    if response.status_code in (307, 308) and response.headers.get("Location"):
        redirect_url = response.headers["Location"]
        response = client.get(redirect_url, allow_redirects=False)
    response.raise_for_status()
    return response.content

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • [v1.x] Follow redirects only within the MCP endpoint's origin (#3448) (modelcontextprotocol/python-sdk)
    examples/clients/simple-auth-client/mcp_simple_auth_client/main.py · SimpleAuthClient.connect, examples/servers/simple-tool/mcp_simple_tool/server.py, examples/servers/simple-tool/mcp_simple_tool/server.py · fetch_website, examples/snippets/clients/oauth_client.py · main, src/mcp/client/auth/oauth2.py, src/mcp/client/auth/oauth2.py · OAuthClientProvider._handle_refresh_response, src/mcp/client/auth/oauth2.py · OAuthClientProvider._handle_token_response, src/mcp/client/auth/utils.py, src/mcp/client/auth/utils.py · handle_auth_metadata_response, src/mcp/client/auth/utils.py · handle_registration_response, src/mcp/client/sse.py, src/mcp/client/sse.py · sse_client and 9 more
  • Follow redirects only within the MCP endpoint's origin (#3397) (modelcontextprotocol/python-sdk)
    docs_src/client_transports/tutorial003.py · main, docs_src/identity_assertion/tutorial001.py · main, examples/clients/simple-auth-client/mcp_simple_auth_client/main.py · SimpleAuthClient.connect, examples/servers/simple-tool/mcp_simple_tool/server.py, examples/servers/simple-tool/mcp_simple_tool/server.py · fetch_website, examples/snippets/clients/identity_assertion_client.py · main, examples/snippets/clients/oauth_client.py · main, src/mcp/client/auth/extensions/identity_assertion.py, src/mcp/client/auth/oauth2.py, src/mcp/client/auth/oauth2.py · OAuthClientProvider._handle_refresh_response, src/mcp/client/auth/oauth2.py · OAuthClientProvider._handle_token_response, src/mcp/client/auth/utils.py and 11 more

Cite this entry

@misc{vaitp:cve2026116685,
  title        = {{Open redirect allowing credential header and body leakage across origins.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-116685},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-116685/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.