AI security news · 3 min read

A malicious MCP server could collect your secrets.

The official Model Context Protocol (MCP) Python SDK had an OAuth flaw that let an untrusted MCP server receive credentials meant for someone else. Updating fixes most of it, but not all.

A malicious MCP server could collect your secrets.: HanulSec guide
Key points
  • CVE-2026-115563 is rated High (CVSS 3.1 score 7.5) in the GitHub advisory GHSA-qx49-fqc8-xw99.
  • An untrusted MCP server could point the client at a token endpoint it controls and receive client secrets, authorisation codes or signed assertions.
  • Affected: mcp 1.9.1 to 1.29.1 and 2.0.0 to 2.1.1. Fixed in 1.30.0 and 2.2.0.
  • Two unattended providers also need the issuer set and stored registrations cleared after updating.
A malicious MCP server could collect your secrets.: HanulSec AI Security Brief
MCP Python SDK · CVE-2026-115563 · the one-page brief we shared on LinkedIn.

What happened

MCP is the protocol AI agents use to connect to tools and data. The official Python SDK includes OAuth clients so agents can sign in to MCP servers. The advisory explains that the client did not check the issuer in the authorisation server’s metadata, and stored credentials were not tied to the server they belonged to. As a result, an untrusted MCP server could send the client to a token endpoint of its choosing, and the client would hand over a client secret, an authorisation code, a PKCE code verifier or a signed client assertion.

Who is affected

  • Developers using the mcp Python package versions 1.9.1 to 1.29.1, or 2.0.0 to 2.1.1 (in 2.x only on fallback discovery)
  • AI agents that connect to MCP servers you do not fully control
  • Services using the ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, which need extra steps after updating

Why it matters

AI agents increasingly connect to many MCP servers, some written by third parties. One hostile or compromised server should never be able to collect credentials meant for another. This flaw shows that connecting an agent to a new tool server is a trust decision, even when the client code is official.

What to do now

  • Update to mcp 1.30.0 or 2.2.0.
  • For the two unattended providers, set issuer= and clear stored client registrations, as the advisory describes.
  • If an agent may have talked to an untrusted MCP server, rotate the client secrets and revoke the tokens involved.
  • Keep a list of which MCP servers your agents connect to, and who runs each one.

How HanulSec helps

  • We map every MCP server your agents talk to, and who controls it.
  • We stand up hostile MCP servers in testing to see exactly what your agents hand over.
  • We check that secrets are bound to the right server, scoped tightly and rotated after any exposure.
Want us to test yours?

Tell us what you run and we will send a fixed-price proposal within one business day. Request a quote.

Questions

Quick answers.

Does updating the SDK fix everything?
Not for every setup. The advisory says upgrading alone does not close the hole for the two unattended providers: they also need the issuer set and stored registrations cleared.
What is MCP?
The Model Context Protocol is an open standard that lets AI agents connect to tools and data sources, such as files, databases and business apps, through MCP servers.
Request a quote

Scope it in two minutes.

Tell us what you need protected. A security engineer, not a salesperson, replies with a fixed-price proposal.

  • Reply within one business day
  • Free 30-minute scoping call
  • Mutual NDA before any detail is shared
  • Fixed price, free retest of fixed findings