MCP Python SDK OAuth Discovery Flaw Exposes Credentials to Malicious Servers
Vulnerability Disclosure · 4 sources · Updated 2mo ago · First seen Sep 28, 2026

A high-severity OAuth credential-disclosure vulnerability in Anthropic's official Model Context Protocol (MCP) Python SDK can allow a malicious HTTP MCP server to capture OAuth client secrets, authorization codes, PKCE verifiers, and ultimately valid access tokens. The attack abuses authorization-server discovery: an attacker-controlled server returns a 404 for modern discovery to trigger a legacy fallback that does not validate the issuer, then supplies malicious authorization metadata or token endpoints while presenting a legitimate identity-provider login flow to the user.
The issue affects mcp versions 1.9.1 through 1.29.1 and 2.0.0 through 2.1.1, including OAuthClientProvider, ClientCredentialsOAuthProvider, and PrivateKeyJWTOAuthProvider configurations using vulnerable OAuth providers. It is fixed in versions 1.30.0 and 2.2.0; organizations should upgrade, explicitly bind machine-to-machine or pre-provisioned credentials to the expected issuer, remove legacy stored registrations, and rotate exposed client secrets and revoke potentially compromised tokens. No CVE or confirmed exploitation had been reported.


