IncidentMCP servers and tools
MCP TypeScript SDK: a malicious MCP server could choose where the client's OAuth secrets were sent
The official MCP TypeScript SDK's OAuth client did not tie credentials to the authorization server they belong to, so a malicious or compromised MCP server could name its own authorization server and the client would send it, with no user interaction, a refresh token and client secret stored from an earlier sign-in, or the client secret or signed assertion configured on one of the SDK's bundled non-interactive providers. The advisory, published on October 6 and crediting six reporters, says it is fixed in @modelcontextprotocol/sdk 1.31.0 and @modelcontextprotocol/client 2.2.0, adds an expectedIssuer option for the bundled providers, and advises deleting saved credentials without an issuer field and rotating secrets exposed to an untrusted server. It is the TypeScript counterpart of the Python SDK flaw reported in September.
Replay the attack step by step in the Learning Center
How it happened
- The MCP server advertises an authorization server it controls.
- The client sends its stored or configured credentials there without checking the issuer.
Impact
Theft of OAuth refresh tokens, client secrets or signed assertions, which open the real services behind them.
The fix
Upgrade to @modelcontextprotocol/sdk 1.31.0 or @modelcontextprotocol/client 2.2.0, set expectedIssuer on bundled providers, delete credentials saved without an issuer, and rotate secrets used with untrusted servers.
Lessons
- Connecting to an MCP server should never let it decide where your credentials go.
- The same flaw in two official SDKs a week apart is a reason to check every MCP client library you use.