The vulnerability is an incorrect authorization (CWE-863) issue in the MCP Python SDK's server-side bearer authentication. The root cause is that BearerAuthBackend.authenticate (in src/mcp/server/auth/middleware/bearer_auth.py) validated a bearer token's existence, expiry, and scopes, but never compared the token's audience/resource (AccessToken.resource, the RFC 8707 resource indicator / aud claim) against the server's own resource_server_url. As a result, when a single authorization server issued tokens for multiple services, a valid token minted for a different service would be accepted by this MCP server.
The fix (commits 0c9136841ff092987a20700ff9c2c9789bda2f40 for 2.x and 8c2fa6eabacde869d75568e33b9d466b58c2f512 for 1.x) adds an opt-in AuthSettings.validate_token_resource setting. When enabled, BearerAuthBackend is constructed with resource_server_url, and authenticate now calls the new _issued_for_this_resource helper to reject any token whose AccessToken.resource does not match resource_server_url (returning None, which yields a 401). The TokenVerifier.verify_token protocol docstring was updated to instruct implementers to populate AccessToken.resource with the token's audience.
The primary vulnerable function is BearerAuthBackend.authenticate, which is the authentication gate that lacked the audience check. The _issued_for_this_resource method is the mitigation added by the patch (not present in the vulnerable version). TokenVerifier.verify_token is the input-processing function whose returned AccessToken lacked audience validation in the vulnerable flow.