Skip to content
MediumVulnerability

GHSA-w4fh-qvv9-3v23: Model Context Protocol Python SDK: Server bearer-token authentication accepts tokens issued for a different resource server

Published
Record updated
View JSON
Affected
  • mcp >= 1.10.0, < 1.30.0, fixed in 1.30.0
  • mcp >= 2.0.0, < 2.2.0, fixed in 2.2.0
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.

Summary

The MCP Python SDK's server-side bearer authentication did not check that a token was issued for the receiving server (its audience). Where one authorization server issues tokens for several services, a valid token for another service was accepted by the MCP server. Affected versions are mcp 1.10.0 through 1.29.1 and 2.0.0 through 2.1.1.

Mitigation

Upgrade to mcp 1.30.0 or later (1.x) or mcp 2.2.0 or later (2.x), then set validate_token_resource=True in AuthSettings with resource_server_url set to the audience the authorization server puts in tokens, and return the token's audience from verify_token() as AccessToken.resource. Upgrading alone changes nothing. If your TokenVerifier already checks the audience, set validate_token_resource=False to silence the deprecation warning. If you cannot upgrade yet, reject any token whose aud does not include your server inside verify_token().