# Model Context Protocol Python SDK: OAuth client could send credentials to an authorization server chosen by the MCP server

MCP Python SDK OAuth client trusted server-advertised authorization server metadata, letting a malicious MCP server receive client_secret, auth code and PKCE verifier meant for the real AS.

- Payout: Research
- Severity: high
- Program: MCP Python SDK
- Found by: Aviral2642, AlexMelanFromRingo, Gal3m, mrostamipoor
- Disclosed: 2026-11-19
- CVE: CVE-2026-115563
- Write-up quality: 7/10
- Original: https://github.com/advisories/GHSA-qx49-fqc8-xw99
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-qx49-fqc8-xw99
- Tags: area:ai domain:ai domain:api impact:data-leak kind:research platform:ghsa sev:high tech:llm tech:oauth tech:python vuln:auth-bypass vuln:secrets-leak

**Target:** OAuth client in mcp.client.auth (MCP client over HTTP)
**Root cause:** Authorization server metadata `issuer` was not validated on every discovery path, and stored/pre-provisioned client credentials were not bound to a specific authorization server, so the MCP server controlled where credentials were sent.
**Steps:**
1. Client connects to a malicious/compromised MCP server over HTTP using OAuthClientProvider, ClientCredentialsOAuthProvider, PrivateKeyJWTOAuthProvider or RFC7523OAuthClientProvider as transport auth handler.
2. Server either names its own authorization server in protected resource metadata, or publishes none and serves metadata presenting the user's real AS as `issuer`.
3. Client fetches authorization server metadata without validating `issuer` (1.9.1-1.29.1 all paths; 2.0.0-2.1.1 legacy fallback or `403 insufficient_scope`).
4. Client sends client_secret, authorization code and PKCE `code_verifier` (or signed client assertion) to the attacker's token endpoint.
**Exploitation:** Malicious MCP server advertises attacker-controlled authorization server metadata (or spoofs the real issuer when no protected resource metadata is published), causing the SDK client to POST its client_secret, auth code and PKCE code_verifier to the attacker's token endpoint, which can then redeem them at the real AS.
**Insight:** OAuth clients must pin the expected issuer before fetching AS metadata and bind stored client registrations to that issuer; any server-supplied discovery document is attacker-controlled input, including the legacy no-metadata fallback and 403 insufficient_scope paths.

