VAITP Dataset

← Back to the dataset

CVE-2026-116684

Token confusion: bearer token accepted for wrong service due to missing audience check.

  • CVSS 6.8
  • CWE-863
  • 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.10.0 until 1.30.0 and 2.2.0, server-side bearer authentication configured through AuthSettings with token_verifier accepts a valid token issued for another service when the authorization server serves multiple resources and the TokenVerifier does not independently validate the aud audience. This resource-confusion flaw lets a token holder authenticate to the wrong MCP server and exercise that token's resulting access. This issue is fixed in versions 1.30.0 and 2.2.0.

CVSS base score
6.8
Published
2026-10-27
OWASP
A01 Broken Access Control
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Authentication, Authorization, and Session Management
Subcategory
Insecure Authentication Mechanisms
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Model Context Protocol Python SDK
Fixed by upgrading
Yes

Solution

Upgrade the SDK to version 1.30.0 or later (or 2.2.0 or later for the newer major line).

Vulnerable code sample

from mcp_sdk.auth import AuthSettings, TokenVerifier

def create_server_auth():
    # VULNERABLE: does not validate token audience, allowing token confusion
    verifier = TokenVerifier(
        jwks_url="https://auth.example.com/.well-known/jwks.json",
        issuer="https://auth.example.com/",
        # No audience check performed here
    )
    auth = AuthSettings(token_verifier=verifier)
    return auth

Patched code sample

from mcp_sdk.auth import AuthSettings, TokenVerifier

def create_server_auth():
    # FIX: validates token audience to prevent resource‑confusion
    verifier = TokenVerifier(
        jwks_url="https://auth.example.com/.well-known/jwks.json",
        issuer="https://auth.example.com/",
        audience="my-mcp-service",  # enforce expected audience
    )
    auth = AuthSettings(token_verifier=verifier)
    return auth

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.

  • Add AuthSettings.validate_token_resource to check a bearer token's resource (#3447) (modelcontextprotocol/python-sdk)
    docs_src/authorization/tutorial001.py, examples/servers/simple-auth/mcp_simple_auth/server.py · create_resource_server, examples/servers/simple-auth/mcp_simple_auth/token_verifier.py · IntrospectionTokenVerifier.verify_token, examples/snippets/servers/oauth_server.py, examples/stories/bearer_auth/server.py · build_app, examples/stories/bearer_auth/server.py · StaticTokenVerifier.verify_token, examples/stories/bearer_auth/server_lowlevel.py · build_app, examples/stories/oauth_client_credentials/server.py · build_app, examples/stories/oauth_client_credentials/server_lowlevel.py · build_app, examples/stories/_shared/auth.py · auth_settings, src/mcp/server/auth/middleware/bearer_auth.py, src/mcp/server/auth/middleware/bearer_auth.py · BearerAuthBackend.authenticate and 6 more
  • [v1.x] Add AuthSettings.validate_token_resource to check a bearer token's resource (#3451) (modelcontextprotocol/python-sdk)
    examples/servers/simple-auth/mcp_simple_auth/server.py · create_resource_server, examples/servers/simple-auth/mcp_simple_auth/token_verifier.py · IntrospectionTokenVerifier.verify_token, src/mcp/server/auth/middleware/bearer_auth.py, src/mcp/server/auth/settings.py, src/mcp/server/fastmcp/server.py · FastMCP.sse_app, src/mcp/server/fastmcp/server.py · FastMCP.streamable_http_app

Cite this entry

@misc{vaitp:cve2026116684,
  title        = {{Token confusion: bearer token accepted for wrong service due to missing audience check.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-116684},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-116684/}}
}

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.