Model Context Protocol OAuth client sends credentials to wrong authorization server

HighSE Fix-First Score 43/100CVE-2026-104850SE-AIV-01575Exposure of secrets or private dataAI agents and assistantsMade public 6 Oct 2026

Download as PDF

What this means

A malicious or compromised MCP server can receive OAuth refresh tokens, client secrets, and signed assertions meant for legitimate services. An attacker with these credentials can access accounts and data protected by the real authorization server without needing the user's password.

SecurityElites Manager Brief: the decision in one minute

The OAuth client in the Model Context Protocol was sending credentials to any authorization server a malicious MCP server claimed to use, without checking that it was the real one. This lets an attacker steal refresh tokens and client secrets. You must upgrade the packages immediately, check stored credentials, and configure bundled providers to verify the authorization server.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixThe team that builds or maintains applications using the Model Context Protocol SDK or client library.
Likely effortAbout 15 minutes per application: upgrade the packages, test the connection, and clear or update any stored credentials. Identifying all places where credentials are stored may take longer.

Questions to ask your team or supplier

  • Do you know which of your applications use the Model Context Protocol SDK or client, and which versions are deployed to production? Can you upgrade them quickly without breaking changes?
  • Have you stored OAuth credentials or client information using the Model Context Protocol? If so, do you have a way to identify which credentials were saved before the fix and either delete them or add the issuer field?
  • Which MCP servers does your application connect to, and can you verify that you trust every server on that list? Should you restrict which servers your application is allowed to reach using network policies?

Message you can forward to the owning team

Security notice: Model Context Protocol OAuth client sends credentials to wrong authorization server (CVE-2026-104850)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to @modelcontextprotocol/sdk 1.31.0, @modelcontextprotocol/client 2.2.0 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/cve-2026-104850-model-context-protocol-oauth-client-sends-credentials-to-wrong/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01575

What is at stake in your AI setup

  • OAuth refresh tokens and client secrets: an attacker can use these to impersonate your application and access AI provider APIs and services on your behalf.
  • Keys for AI providers: if stored alongside OAuth credentials, they can be exfiltrated to a malicious MCP server and used to run workloads at your expense.
  • Tools and systems the agent is connected to: a malicious MCP server with your credentials can call any API or system your agent normally connects to, triggering unintended actions.

Map where your company uses AI

Who is exposed

  • Applications that use @modelcontextprotocol/sdk 1.12.0 to 1.30.1 with OAuth authentication over HTTP
  • Applications that use @modelcontextprotocol/client 2.0.0 to 2.1.0 with OAuth, especially if they store credentials or use bundled providers
  • Teams that connect to MCP servers from untrusted sources or networks while holding OAuth credentials
  • Services that rely on stored refresh tokens or client secrets to access other systems on behalf of users

Upgrades you need

SoftwareAffected versionsMove to
@modelcontextprotocol/sdk
npm
1.12.0 up to, but not including, 1.31.01.31.0 or later
@modelcontextprotocol/client
npm
2.0.0 up to, but not including, 2.2.02.2.0 or later

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Is it being attackedNo known attacks and no public attack code when CISA last reviewed it
Where the attacker must beAnywhere that can reach it over a network, including the internet if it is exposed
Account neededNone. No login is needed
Does a person have to do somethingNo. It works without anyone clicking or opening anything
How hard it is to doEasy. It works reliably once the attacker can reach it
Risk of: data being readHigh
Risk of: data or settings being changedNone
Risk of: the service being taken downNone
Can attackers automate it at scaleYes, according to CISA
How much control an attacker gainsPartial control, according to CISA

Read from the official severity rating: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Kind of coding mistake

  • CWE-345
  • CWE-522: credentials are not protected well enough

Where it sits in the standards

OWASP Top 10 for LLM Applications 2025: LLM02 Sensitive Information Disclosure

If you cannot upgrade today

  • Until you can upgrade, do not connect to MCP servers over HTTP. Use HTTPS or other encrypted, authenticated transports to prevent network interception and to reduce the risk that a compromised server can read or modify the connection.
  • If you use bundled providers, do not rely on them to verify the authorization server. Instead, hard-code the authorization server URL in your configuration and reject any connection to a server that tries to use a different one.
  • Clear all stored OAuth tokens and client secrets. Force users to sign in again after every application restart until you can upgrade.

Signs it may already have been used against you

  • Check authorization server logs for token requests from before the upgrade date that do not match your known MCP servers or application instances.
  • Look in application logs for successful OAuth authentication events where the `issuer` or authorization server URL differs from your configured server.
  • Search for error messages in authentication middleware or OAuth client logs that mention mismatched issuers or authorization server verification failures.
  • Review credential storage (files, keychains, databases) for OAuth tokens that do not have an `issuer` field or have an incorrect issuer value.

SecurityElites Fix Guide: step by step

  1. Find where the Model Context Protocol packages are installedCheck your package.json and package-lock.json (or yarn.lock) for @modelcontextprotocol/sdk, @modelcontextprotocol/client, and @modelcontextprotocol/core. Note the current version of each package. If you are not sure which files contain the OAuth client, search your code for imports of 'authProvider', 'withOAuth()', 'auth()', or 'fetchToken()'.
  2. Upgrade @modelcontextprotocol/sdk to 1.31.0 or laterIf your application uses the SDK (version 1.x), upgrade to 1.31.0 or later using your package manager. Run the upgrade command and verify it completes without errors.
  3. Upgrade @modelcontextprotocol/client to 2.2.0 or laterIf your application uses the client (version 2.x), upgrade @modelcontextprotocol/client to 2.2.0 or later. Also upgrade @modelcontextprotocol/core to 2.2.0 or later if you import it directly in your code.
  4. Add issuer configuration to bundled OAuth providersIf you use ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider, or CrossAppAccessProvider, add the `expectedIssuer` parameter with the correct authorization server URL. For example: `expectedIssuer: 'https://auth.example.com'`. Do this for every provider, even after upgrading the package.
  5. Clear or update stored OAuth credentialsFind any file, keychain, database, or storage location where your application saves OAuth tokens and client information. Delete all credentials saved before you upgraded, or add the `issuer` field to them with the correct authorization server URL. After this step, users may need to sign in again the next time they use the application.
  6. Test that OAuth authentication still worksStart the application and go through the OAuth sign-in flow. Verify that you can authenticate with the authorization server and that the connection to the MCP server succeeds. Check that no error messages appear during authentication.
  7. Check logs for signs that credentials were leaked before the fixReview application logs and authorization server logs from before the upgrade date. Look for successful authentication or token requests from servers or IP addresses you do not recognize, or for token use from unusual times or places. If you find signs of compromise, revoke the exposed refresh tokens and client secrets immediately.
  8. Review your MCP server connectionsList every MCP server your application connects to and confirm you trust it. If you are not sure about the origin or the operator of a server, do not connect to it while holding OAuth credentials. Consider using network controls to restrict which servers your application can reach.

How to confirm it is fixed: Run `npm list @modelcontextprotocol/sdk @modelcontextprotocol/client` and confirm the version is 1.31.0 or later for the SDK, or 2.2.0 or later for the client. Verify that bundled providers have the `expectedIssuer` parameter set and that stored credentials ha

SecurityElites Quick Fixes: copy and paste

Upgrade @modelcontextprotocol/sdk with npmupgrade

npm install @modelcontextprotocol/sdk@1.31.0
npm ls @modelcontextprotocol/sdk

Upgrade @modelcontextprotocol/client with npmupgrade

npm install @modelcontextprotocol/client@2.2.0
npm ls @modelcontextprotocol/client

Check installed version of @modelcontextprotocol/sdkfor this issue

npm list @modelcontextprotocol/sdk @modelcontextprotocol/client @modelcontextprotocol/core

Example: add expectedIssuer to bundled providerfor this issue

const provider = new ClientCredentialsProvider({
  clientId: 'my-client',
  clientSecret: 'my-secret',
  tokenUrl: 'https://auth.example.com/token',
  expectedIssuer: 'https://auth.example.com'
});

Read a key from the environment instead of the code (Python)general hardening

import os
api_key = os.environ["SERVICE_API_KEY"]

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (CVE-2026-104850) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - @modelcontextprotocol/sdk (npm): must be 1.31.0 or later
   - @modelcontextprotocol/client (npm): must be 2.2.0 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

Why did the OAuth client send credentials to the wrong authorization server?A good answer: The client did not record or verify which authorization server the credentials belonged to, so a malicious MCP server could name any server it wanted and the client would send it the stored tokens and secrets.
What can an attacker do with a leaked refresh token or client secret?A good answer: They can use it to request new access tokens for the authorization server, which lets them access APIs and services as your application, without needing the user's password.
What do we have to do beyond upgrading the package to fully fix this?A good answer: If you use bundled providers, add the `expectedIssuer` parameter. If you store credentials, delete those saved before the upgrade or add the `issuer` field to them. If you wrote your own OAuth provider, make sure it stores and checks the is
How can we tell if a malicious MCP server already received our credentials before we upgraded?A good answer: Check the authorization server logs and application logs for authentication requests from before the upgrade that came from unexpected servers, IP addresses, or at unusual times; also look for successful token use from accounts or integrati

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## Model Context Protocol OAuth client sends credentials to wrong authorization server (CVE-2026-104850)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-01575 https://securityelites.com/ai-vulnerabilities/cve-2026-104850-model-context-protocol-oauth-client-sends-credentials-to-wrong/

### Why this matters
A malicious or compromised MCP server can receive OAuth refresh tokens, client secrets, and signed assertions meant for legitimate services. An attacker with these credentials can access accounts and data protected by the real authorization server without needing the user's password.

### What to do
1. Find where the Model Context Protocol packages are installed
2. Upgrade @modelcontextprotocol/sdk to 1.31.0 or later
3. Upgrade @modelcontextprotocol/client to 2.2.0 or later
4. Add issuer configuration to bundled OAuth providers
5. Clear or update stored OAuth credentials
6. Test that OAuth authentication still works
7. Check logs for signs that credentials were leaked before the fix
8. Review your MCP server connections

Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-104850-model-context-protocol-oauth-client-sends-credentials-to-wrong/

### Done when
- [ ] @modelcontextprotocol/sdk is at 1.31.0 or later everywhere it is installed
- [ ] @modelcontextprotocol/client is at 2.2.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Run `npm list @modelcontextprotocol/sdk @modelcontextprotocol/client` and confirm the version is 1.31.0 or later for the SDK, or 2.2.0 or later for the client. Verify that bundled providers have the `expectedIssuer` parameter set and that stored credentials ha
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Change history

  • 6 Oct 2026: Made public
  • 2 Dec 2026: Published

Official record

### Summary In affected versions, the SDK's OAuth client let the MCP server decide which authorization server received the client's OAuth credentials. Credentials were not tied to the authorization server they belong to.A malicious or compromised MCP server could name its own authorization server. With no user interaction, the client would send it:- the `refresh_token` and `client_secret` stored from an earlier sign-in - the `client_secret` or signed assertion configured on a bundled provider### Am I affected? Yes, if both of these hold:- your application uses the SDK's OAuth client over HTTP, through any of: - an `authProvider` on a transport - the `withOAuth()` middleware - direct calls to `auth()` or `fetchToken()` - it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization serverAffected versions:- `@modelcontextprotocol/sdk` 1.12.0 through 1.30.1 - `@modelcontextprotocol/client` 2.0.0 through 2.1.0, only for: - bundled providers without `expectedIssuer` - credentials stored or supplied without `issuer` - direct calls to `fetchToken()` - providers that read storage back through `OAuthTokensSchema` or `OAuthClientInformationSchema`Not affected:- MCP servers built with the SDK - stdio clients### Fix Upgrade to:- 1.x: `@modelcontextprotocol/sdk` 1.31.0 or later - 2.x: `@modelcontextprotocol/client` 2.2.0 or later, and `@modelcontextprotocol/core` 2.2.0 or later if you import it directlyThe client now records the authorization server as `issuer` on saved credentials and does not send them to a different one. The user signs in again, or the call throws.In the following cases, upgrading to the patched version is not enough. You also need to make a change:- **Bundled providers** (`ClientCredentialsProvider`, `PrivateKeyJwtProvider`, `StaticPrivateKeyJwtProvider`, `CrossAppAccessProvider`): pass `expectedIssuer`, for example `expectedIssuer: 'https://auth.example.com'`. Without it they still use whichever authorization server the MCP server names. - **Credentials saved without `issuer`:** tokens and client information your `OAuthClientProvider` persisted (file, keychain, database) before upgrading, including everything 1.x saved before 1.31.0. They still go to whichever authorization server is named at first use. Add `issuer` to them, or clear them so users sign in again. - **Your own `OAuthClientProvider`:** save exactly what `saveTokens()` and `saveClientInformation()` are given, including `issuer`. For pre-registered credentials, include `issuer` in what `clientInformation()` returns.Not covered by this fix:- a new interactive sign-in, which still goes to the authorization server the MCP server names. Only complete sign-ins for servers you trust. - `refreshAuthorization()` and `exchangeAuthorization()` called directly - 2.x with `skipIssuerMetadataValidation: true`If an affected client may have connected to an untrusted MCP server, rotate its client secret or signing key and revoke its tokens.If you cannot upgrade yet, connect OAuth clients only to MCP servers you trust. 2.0.0 and 2.1.0 already accept `expectedIssuer`.

Weakness type: CWE-345, CWE-522

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/CVE-2026-104850

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 2 Dec 2026. Read the vendor advisory before changing a production system.