Anthropic MCP Python SDK Flaw Enables OAuth Credential Theft and Account Takeover
Malicious MCP servers can steal OAuth credentials and hijack accounts via a legacy fallback flaw in Anthropic's MCP Python SDK; upgrade to 1.30.0/2.2.0.
Cycode researchers disclosed a high-severity OAuth discovery flaw in Anthropic's MCP Python SDK affecting HTTP-transport clients, with vulnerable releases 1.9.1–1.29.1 on the 1.x branch and 2.0.0–2.1.1 on the 2.x branch. A malicious MCP server returning HTTP 404 forces a legacy fallback path that skips issuer validation, redirecting token exchanges to attacker-controlled endpoints and capturing authorization codes, client secrets, and PKCE code verifiers. Machine-to-machine providers like ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider expose automated AI agents and backend workflows to silent credential theft. The flaw is fixed in versions 1.30.0 and 2.2.0; users should also rotate client secrets, revoke tokens, and clear legacy stored OAuth registrations.
- Flaw in OAuth discovery fallback skips issuer validation on HTTP-transport MCP clients
- Affects SDK 1.9.1–1.29.1 and 2.0.0–2.1.1; fixed in 1.30.0 and 2.2.0
- Attackers capture authorization codes, client secrets, and PKCE verifiers for token theft
- Machine-to-machine OAuth providers enable silent credential theft from AI agents
- Rotate secrets, revoke tokens, and clear legacy registrations after upgrading
From the original article
3 min read at gbhackers.com
Security researchers have disclosed a high-severity vulnerability in Anthropic’s Model Context Protocol (MCP) Python SDK. This flaw could allow a malicious MCP server to steal OAuth credentials, potentially taking over user accounts. The vulnerability affects MCP client deployments that use HTTP transport and includes vulnerable SDK releases from versions 1.
By Divya · gbhackers.com
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.