CVE-2026-116686
Blind SSRF & file read via uncontrolled jsonschema $ref resolution in Model Context SDK.
- CVSS 6.5
- CWE-918
- Input Validation and Sanitization
- Remote
The Model Context Protocol Python SDK is the official Python SDK for Model Context Protocol servers and clients. From 1.10.0 until 1.30.0 and 2.2.0, ClientSession, ClientSessionGroup, and Client tool calls validate server-declared outputSchema documents with jsonschema's default resolver, causing an unresolved $ref value to fetch an HTTP, HTTPS, or file URL from the client's network and filesystem context. A server can trigger blind requests or local-file reads and can stall every session in the process because resolution runs synchronously on the event loop without a timeout. This issue is fixed in versions 1.30.0 and 2.2.0.
- CWE
- CWE-918
- CVSS base score
- 6.5
- Published
- 2026-10-27
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Information Disclosure
- Affected component
- Python
- Fixed by upgrading
- Yes
Solution
Upgrade the SDK to Model Context Protocol Python SDK ≥ 1.30.0 or ≥ 2.2.0, which contain the fix.
Vulnerable code sample
import json
import jsonschema
from model_context import ClientSession
def load_output_schema(session: ClientSession, schema_json: str) -> dict:
# VULNERABLE: uses default resolver allowing $ref to external URLs
schema = json.loads(schema_json)
validator = jsonschema.Draft7Validator(schema) # default resolver used here
# Trigger validation of a dummy response to exercise the resolver
dummy_response = {}
validator.validate(dummy_response)
return schemaPatched code sample
import json
import jsonschema
from model_context import ClientSession
from jsonschema import RefResolver
def load_output_schema(session: ClientSession, schema_json: str) -> dict:
# FIX: restrict resolver to local schemas only, preventing external $ref fetches
schema = json.loads(schema_json)
resolver = RefResolver(base_uri="", referrer=schema, store={})
validator = jsonschema.Draft7Validator(schema, resolver=resolver)
dummy_response = {}
validator.validate(dummy_response)
return schemaPublished 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] Resolve tool output-schema references within the schema document only (#3396) (modelcontextprotocol/python-sdk)
src/mcp/client/session.py · ClientSession._validate_tool_result - Resolve tool output-schema references within the schema document only (#3394) (modelcontextprotocol/python-sdk)
src/mcp/client/session.py · ClientSession.validate_tool_result,src/mcp/client/session.py · ClientSession._output_schema_validator
Cite this entry
@misc{vaitp:cve2026116686,
title = {{Blind SSRF & file read via uncontrolled jsonschema $ref resolution in Model Context SDK.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-116686},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-116686/}}
}
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 ::
