NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MCP Python SDK

CVE-2026-116684: Model Context Protocol Python SDK: Server bearer-token authentication accepts tokens issued for a different resource server

mediumCVSS 3.1 6.8GHSA-w4fh-qvv9-3v23

The MCP Python SDK (mcp on PyPI) accepted bearer tokens that were issued for a different service. Its server-side auth never checked the token's audience. If your authorization server issues tokens for several services, a token meant for another one works against your MCP server. Fixed in mcp 1.30.0 and 2.2.0, but you must also turn the check on.

Published Oct 27, 2026 · Analysis Oct 28, 2026

What an attacker can do

In affected versions, a server that uses auth=AuthSettings(...) with a token_verifier= relies on the verifier to say whether a token is valid. The SDK had no built-in step to confirm the token was minted for this MCP server (its aud claim). A token that is valid for service A on the same authorization server therefore passes on service B.

The attacker needs a valid token from that authorization server for some other resource, so this is a confused-deputy problem rather than anonymous access. The CVSS vector (network, high complexity, low privileges) reflects that. In practice, anyone holding a legitimate token for a sibling service, or a malicious sibling service that receives user tokens, can replay it against your MCP server and use its tools with the original user's identity. MCP servers often front files, databases or SaaS accounts, so the exposure depends on what your tools can do.

You are not exposed if your own TokenVerifier already rejects tokens whose aud does not include your server, or if your authorization server issues tokens for your server only.

Who is affected

Affected: mcp 1.10.0 through 1.29.1, and mcp 2.0.0 through 2.1.1. You are affected only if your HTTP server uses the SDK's bearer authentication (AuthSettings with token_verifier), the authorization server also issues tokens for other services, and your TokenVerifier does not check aud itself.

Check the installed version:

pip show mcp

Then review your TokenVerifier.verify_token() implementation for an audience check.

mcp

Ecosystem
PyPI
Affected
>= 2.0.0, < 2.2.0
Fixed in
2.2.0
Check
pip show mcp

mcp

Ecosystem
PyPI
Affected
>= 1.10.0, < 1.30.0
Fixed in
1.30.0
Check
pip show mcp

How to fix it

Upgrade to mcp 1.30.0 or later on 1.x, or mcp 2.2.0 or later on 2.x:

pip install --upgrade "mcp>=1.30.0,<2"

Upgrading alone changes nothing. The new validate_token_resource setting is off by default. Turn the check on with two changes together:

  • Set validate_token_resource=True in AuthSettings, with resource_server_url set to the audience your authorization server puts in tokens for your server.
  • Return the token's audience from verify_token() as AccessToken.resource.

With only the first change, every request gets 401. If your verifier already checks aud, set validate_token_resource=False to silence the new deprecation warning; the default becomes True in 3.0. If you cannot upgrade, reject any token whose aud does not include your server inside verify_token(). That closes the issue on every version.

How to tell if you were hit

Compare the aud claim of tokens your server accepted with your server's own resource URL. Log the audience in verify_token() if you do not already. Any accepted token whose aud names another service points to cross-service reuse. Also check your authorization server's logs for tokens issued to other resources that later show up in requests to your MCP endpoint.

After the upgrade, a DeprecationWarning appears at startup when resource_server_url is set and validate_token_resource is not, which helps find servers you have not configured yet.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

In affected versions, the SDK's server-side bearer authentication had no way to check that a token was issued for your server (its audience). Where one authorization server issues tokens for several services, a valid token for another service was also accepted by your MCP server.

Am I affected?

Yes, if your HTTP server uses the SDK's bearer authentication (auth=AuthSettings(...) with token_verifier=), its authorization server also issues tokens for other services, and your TokenVerifier does not check the token's audience (aud) itself.

Affected versions:

  • mcp 1.10.0 through 1.29.1
  • mcp 2.0.0 through 2.1.1

Fix

Upgrade to:

  • 1.x: mcp 1.30.0 or later
  • 2.x: mcp 2.2.0 or later

Upgrading alone changes nothing. The patched versions add a validate_token_resource setting that is off unless you set it. To turn the check on, make both of these changes together:

  1. Set validate_token_resource=True in AuthSettings, with resource_server_url set to the audience your authorization server puts in tokens for your server.
  2. Return the token's audience from verify_token() as AccessToken.resource.

A token for another service then gets 401. With only the first change, every request gets 401.

If your TokenVerifier already checks the audience, set validate_token_resource=False to silence the deprecation warning. The setting will default to True in 3.0.

If you cannot upgrade yet, reject any token whose aud does not include your server inside verify_token(). That closes the issue on every version.

Credited to u-ktdi.

Questions

I upgraded to mcp 1.30.0. Am I protected?

Not yet. The check is opt-in. You must set validate_token_resource=True in AuthSettings and return the audience from verify_token() as AccessToken.resource.

Why does every request return 401 after I set validate_token_resource=True?

Your TokenVerifier is not populating AccessToken.resource. The server compares it with resource_server_url, so the verifier must return the token's audience.

Does this affect stdio MCP servers?

The advisory covers HTTP servers that use the SDK's bearer authentication. It does not describe stdio servers, which do not use bearer tokens.

Is there a workaround without upgrading?

Yes. Reject any token whose aud does not include your server inside verify_token(). The advisory says this closes the issue on every version.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

Coverage on the Beam blog

More MCP Python SDK vulnerabilities

All MCP Python SDK entries