What is the flaw in the MCP Python SDK?
A client using one of the SDK's OAuth providers could follow the response of an uncontrolled MCP server and send its credentials wherever the server pointed. According to The Hacker News, the flaw was reported by Cycode, and the security advisory (GHSA-qx49-fqc8-xw99) credits eight reporters.
The exposed credentials are the client secret, the authorization code and the PKCE proof. Cycode demonstrated the full exchange in a test: the token obtained carries the permissions granted to the application. The client secret is a long-lived value that keeps working until it is changed.
How does the attack work?
In the SDK's OAuth flow, the client asks the MCP server where the authorization server is, then uses the answer. In the affected versions, the client did not check that this authorization server was the one it expected. A malicious MCP server could therefore name a token endpoint of its own, and the client passed its secrets there.
For an application to be concerned, it must use the SDK as an MCP client over HTTP with one of the affected providers, be able to connect to a server it does not fully control, and hold credentials for a real login service.
Which versions and providers are affected?
- 1.x branch: 1.9.1 through 1.29.1, fixed in 1.30.0.
- 2.x branch: 2.0.0 through 2.1.1, fixed in 2.2.0.
- Providers:
OAuthClientProvider,ClientCredentialsOAuthProvider,PrivateKeyJWTOAuthProviderand, in 1.x, the deprecatedRFC7523OAuthClientProvider. - Severity: 7.5 (high) for the two machine-to-machine providers, 6.5 for the interactive provider, where a person must start the sign-in.
- CVE: none was assigned as of September 29, 2026, and neither the advisory nor Cycode reports attacks exploiting the flaw.
- Not affected: MCP servers built with the SDK, local stdio clients and clients that attach their own tokens.
Why is upgrading alone not enough?
Because two providers require an extra parameter. The advisory states that upgrading changes nothing until you also pass issuer= for ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider: without it, these providers still follow whichever authorization server the MCP server points them to.
The other points to handle after upgrading:
RFC7523OAuthClientProviderhas noissuer=option. Move to one of the other two providers.- The version 1.30.0 warning is a standard Python deprecation warning, hidden by default.
- Stored OAuth client registrations must be cleared once after upgrading, since older ones are not tied to a specific login service.
- If a client may have connected to an untrusted server, change its client secret and revoke its tokens at the login service. Upgrading does not undo what was already transmitted.
On older versions, there is no other workaround than connecting only to trusted MCP servers.
What is the disclosure timeline?
The issuer checks shipped on September 7 in the release notes of 1.30.0 and 2.2.0, listed as behavior changes and not as a security fix. The advisory was published on September 28, the same day as Cycode's write-up. Many deployments may therefore have stayed on an affected version for more than three weeks without a clear signal.
How do you check that your MCP clients are protected?
Check versions, configuration and the servers contacted, then test behavior against a test server.
- Versions: record the SDK version in every Python MCP client that authenticates with OAuth (
pip show mcp). - Provider in use: identify which of the four providers your code uses.
- `issuer=` parameter: verify it is set for the two non-interactive providers, with the expected issuer.
- Servers contacted: list the MCP servers your clients have connected to. Any server you did not deploy should be considered untrusted.
- Test with a test server: in an isolated environment, deploy a fake MCP server that announces a different authorization server, and check that the client rejects the mismatch instead of sending its secrets.
- Rotation: if there is doubt about a server contacted, change the client secret and revoke tokens.
The general frame for these tests is in the MCP security page, and the AI agent security page gives the overview.
Which good practices should you adopt for an MCP client's credentials?
A few rules reduce the effect of a flaw like this one, whether it comes from the SDK or elsewhere.
- Issuer allowlist: the client accepts only a preconfigured set of authorization servers, rather than the one the MCP server announces.
- Separate credentials per server: one client secret per MCP server and per environment, so a leak does not open everything.
- Minimal permissions: grant the application only the scopes it needs, since a stolen token carries exactly those permissions.
- Short lifetime: short-lived access tokens and scheduled rotation of long-lived secrets.
- Monitoring: alerts on unusual use of an OAuth client (address, time, volume) at the login service.
These rules also apply to agents that connect to third-party MCP servers chosen by users: treat each new server as a new supplier, with a review before granting credentials.
A related habit is to keep an inventory of every MCP server your agents are allowed to contact, with its owner, its purpose and the credentials it can trigger. When an advisory like this one lands, the inventory answers in minutes the question that otherwise takes days: which of our clients could have been exposed, and which secrets must we rotate?
What lesson should you draw?
In an OAuth flow, the MCP server is the least trustworthy party in the chain, and yet it decides where the client sends its secrets. An identity must never depend on the response of an uncontrolled third party. This principle holds for every agent integration: discovery URLs, tool metadata and redirect points come from outside and must be validated like untrusted input.
CleanIssue's Agent Red Team Express (EUR 1,900, 5 days) tests an agent's connections to its MCP servers and tools and delivers a report with proof: see the offer. A free 30-minute discovery call is enough to check whether your MCP server exposes OAuth secrets to the agent.
Further reading
Does your product ship an AI agent? CleanIssue tests what a stranger can make it do with the Agent Red Team Express (5 days, €1,900), or a custom red team for several agents and MCP servers. First step: a free 30-minute discovery call.
Related articles
Three adjacent analyses to keep exploring the same attack surface.
Confused Deputy in AI Agents: OAuth and Delegation
An AI agent that carries out a third party’s wishes with your rights is a confused deputy. OAuth, MCP, delegation and tests to run.
LiteLLM CVE-2026-42271: Command Injection via MCP
CVE-2026-42271 (CVSS 8.7): two LiteLLM MCP test endpoints run commands, exploited per CISA. Affected versions, Starlette chain, fixes and how to test.
AI Agent Secrets: API Keys, OAuth Tokens, Rotation
API keys and OAuth tokens of an AI agent: what the model must never see, least privilege, rotation, revocation and how to test for leakage.
Sources
Related services
If this topic maps to a real risk in your stack, these are the most relevant CleanIssue audits.