MCP Python SDK OAuth Flaw Lets Malicious Servers Hijack AI Agent Accounts
Malicious MCP servers can hijack OAuth tokens from vulnerable MCP Python SDK clients to take over AI agent accounts; patched in 1.30.0 and 2.2.0.
Cycode disclosed an OAuth flaw in the official MCP Python SDK where a malicious MCP server returns 404 to a discovery request, forcing a legacy fallback that accepts attacker-controlled OAuth configuration without validating the issuer. The victim signs in at the genuine Google, Okta, or Microsoft Entra ID page, but the authorization code, client secret, and PKCE verifier are sent to an attacker-controlled token endpoint, yielding a valid access token. Affected versions are 1.9.1-1.29.1 (1.x) and 2.0.0-2.1.1 (2.x); machine-to-machine providers were rated 7.5 and interactive flows 6.5. Fixes in 1.30.0 and 2.2.0 validate the issuer across discovery paths and reject unexpected provider metadata.
- Malicious MCP server redirects OAuth token exchange to attacker endpoint
- Steals authorization code, client secret, PKCE verifier for valid access token
- Affects SDK 1.9.1-1.29.1 and 2.0.0-2.1.1; CVSS 7.5 machine-to-machine
- Patch in 1.30.0/2.2.0; rotate secrets and revoke tokens if exposed
From the original article
3 min read at cybersecuritynews.com
A high-severity flaw in the official Model Context Protocol (MCP) Python SDK could allow a malicious MCP server to steal OAuth authentication material and take over AI agent accounts. The issue affects vulnerable HTTP-based MCP clients that connect to untrusted servers while using OAuth to access legitimate identity providers such as Google, Okta, or Microsoft […]
By Abinaya · cybersecuritynews.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.