Plan this weekAI agents

MCP SDK flaw: a malicious server could collect your saved sign-in credentials

The official TypeScript SDK for MCP let a server decide where the client sent its credentials. Fixed versions are out. Here is what it means and what to check.

How urgent

Plan this week

Who is affected

Developers whose app or agent uses the MCP TypeScript SDK as an OAuth client, versions 1.12.0 to 1.30.x or client 2.0.x to 2.1.x

What to do

Update to @modelcontextprotocol/sdk 1.31.0 or @modelcontextprotocol/client 2.2.0, and rotate secrets if you connected to a server you do not trust

Published 22 Oct 2026 · Sources last checked 22 Oct 2026No. 9 / 87

What happened

The official TypeScript SDK for the Model Context Protocol (MCP) had a weakness in its OAuth client. OAuth is the "sign in with..." mechanism many tools use to connect to other services. In this case, the MCP server could choose which authorization server received the client's credentials.

GitHub's advisory (CVE-2026-104850, rated High, CVSSCVSS score A number from 0 to 10 that rates how serious a flaw is in general. From 9.0 up it is called Critical. Tap again to open the glossary 7.5) says a malicious or compromised MCP server could name a server of its own. With no action from the user, the client would then send it the stored refresh token and client secretSecret (API key, token, password) Any piece of text that proves to a service that you are allowed in, such as an API key, a database password or an access token. Tap again to open the glossary, or the client secret or signed assertion configured on a bundled provider. The advisory was published on 30 September 2026 and added to GitHub's advisory database on 6 October 2026.

Who is affected

Developers whose app or AI agent uses the MCP TypeScript SDK as an OAuth client to connect to MCP servers.

  • @modelcontextprotocol/sdk: versions 1.12.0 up to, but not including, 1.31.0.
  • @modelcontextprotocol/client: versions 2.0.0 up to, but not including, 2.2.0.

If you only use an AI app that someone else built, the fix is in their hands. You can ask them whether it has been updated.

What to do

  1. Update to 1.31.0 or later of @modelcontextprotocol/sdk, or 2.2.0 or later of @modelcontextprotocol/client. If you import @modelcontextprotocol/core directly, update it to 2.2.0 or later too.
  2. Connect OAuth clients only to MCP servers you trust.
  3. If you cannot update yet, versions 2.0.0 and 2.1.0 accept an expectedIssuer setting. Bundled providers should set it.
  4. Credentials saved without an issuer field, including those saved by 1.x versions before 1.31.0, still go to whichever server is named the first time. Add the issuer field to them or clear them so users sign in again.
  5. If a client may have connected to a server you do not trust, rotate its client secret or signing key and revoke its tokens.

The advisory also says the fix does not cover new interactive sign-ins, direct calls to refreshAuthorization() or exchangeAuthorization(), or 2.x with skipIssuerMetadataValidation: true. If your code does any of these, check it yourself.

If you build with AI tools

Our advice, not from the advisory: every MCP server you connect is code someone else wrote, and in this case it could steer where your credentials went. Keep a list of the MCP servers each project uses, connect only the ones you need, and give each connection its own key with the smallest permissions. Our runbook #32 (Tool and MCP Trust Sheet) is a one-page way to do that.

Terms explained in this article

Comments

No account needed. Add a nickname if you like, or leave it empty to comment anonymously. Comments are reviewed before they appear. Links are not allowed.

    We store your comment, your nickname and a scrambled form of your connection that we use only to limit spam. We do not store your IP address or set cookies. Cloudflare Turnstile checks that you are not a bot.

    Sources and verification

    We use primary sources first and say when we rely on a news report. Dates are the day we last checked each source.

    Spotted a mistake? Email [email protected] and we will correct it and note the change.

    Get the free runbooks

    One-page security checklists for founders who build with AI. You get a confirmation email first, then the runbooks.

    Send me the runbooks