MCP SDK sends OAuth secrets to wrong server if the server says so
What this means
A malicious or compromised MCP server can steal OAuth client secrets, authorization codes, and signing keys meant for a legitimate authorization server. An attacker could use these credentials to impersonate the client and access protected resources or user data on the real authorization server.
SecurityElites Manager Brief: the decision in one minute
The MCP SDK's OAuth support trusts an MCP server to tell it which authorization server to send credentials to. A bad actor can redirect credentials to their own server instead. Any company using MCP clients with OAuth to connect to servers they do not fully control is at risk of credential theft.
| SecurityElites Fix-First Score | 43 of 100 Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity. |
|---|---|
| SecurityElites fix window | Within 30 days High severity. This is our suggestion from common practice; your own policy comes first. |
| Who should own the fix | The team that builds or maintains applications using the MCP SDK as a client. |
| Likely effort | About 30 minutes per client application: upgrade the SDK and add the `issuer=` parameter to credential providers. Testing to confirm the fix is applied takes another 15 minutes. This is an estimate; teams with many client applications or complex deployment pip |
Questions to ask your team or supplier
- Which of your MCP client applications use OAuth credential providers, and which MCP servers do they connect to—are all of those servers trusted?
- Have you added the `issuer=` parameter to all instances of `ClientCredentialsOAuthProvider` and `PrivateKeyJWTOAuthProvider` after upgrading, and have you tested that they still work?
- Do your authorization server logs show any suspicious token requests or unusual issuer values in the weeks before you applied this fix?
Message you can forward to the owning team
Security notice: MCP SDK sends OAuth secrets to wrong server if the server says so (CVE-2026-115563)
Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to mcp 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-115563-mcp-sdk-sends-oauth-secrets-to-wrong-server-if/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01159What is at stake in your AI setup
- OAuth credentials and API keys used by AI agents or clients to call external services could be stolen and used to impersonate the legitimate client.
- Authorization codes obtained during sign-in flows could be intercepted and replayed to gain unauthorized access to protected resources.
- Signed client assertions (from PrivateKeyJWTOAuthProvider) could be stolen and reused to authenticate as the legitimate client to other services.
Who is exposed
- Teams running MCP client applications with OAuth credential providers (OAuthClientProvider, ClientCredentialsOAuthProvider, PrivateKeyJWTOAuthProvider, or deprecated RFC7523OAuthCl
- Applications that connect to MCP servers outside your organization or in untrusted environments.
- Services that hold pre-provisioned OAuth client secrets or private signing keys for legitimate authorization servers.
- Applications using stdio-based MCP clients or clients that manage their own tokens are not affected.
Upgrades you need
| Software | Affected versions | Move to |
|---|---|---|
| mcp PyPI | 2.0.0a1 up to, but not including, 2.2.0; 1.9.1 up to, but not including, 1.30.0 | 2.2.0 or later |
Each maintained branch has its own fixed version. Stay on your branch if you cannot jump to the newest: mcp 1.30.0, 2.2.0.
Am I affected?
Enter the version you run. Nothing you type is stored.
SecurityElites Developer Brief: the technical picture
| Is it being attacked | No known attacks and no public attack code when CISA last reviewed it |
|---|---|
| Where the attacker must be | Anywhere that can reach it over a network, including the internet if it is exposed |
| Account needed | None. No login is needed |
| Does a person have to do something | No. It works without anyone clicking or opening anything |
| How hard it is to do | Easy. It works reliably once the attacker can reach it |
| Risk of: data being read | High |
| Risk of: data or settings being changed | None |
| Risk of: the service being taken down | None |
| Can attackers automate it at scale | Yes, according to CISA |
| How much control an attacker gains | Partial 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 MCP clients with OAuth credentials to MCP servers outside your direct control.
- If you must connect to external MCP servers, use stdio transport instead of HTTP transport (stdio clients are not affected).
- Rotate all OAuth client secrets and signing keys used by MCP clients as soon as possible, and monitor your authorization servers for suspicious token requests.
Signs it may already have been used against you
- Check your authorization server logs for token requests with unusual issuer metadata or from unexpected clients.
- Review MCP server traffic logs for requests that contain OAuth credential material (client_secret, code_verifier, or signed assertions).
- Search application and MCP server error logs for failed OAuth flows or token validation errors in the period before the fix was applied.
- Look for HTTP requests to unexpected token endpoints in your network traffic or firewall logs.
SecurityElites Fix Guide: step by step
- Find where the MCP SDK is installedSearch your codebase for imports of `mcp.client.auth` or usage of `OAuthClientProvider`, `ClientCredentialsOAuthProvider`, `PrivateKeyJWTOAuthProvider`, or `RFC7523OAuthClientProvider`. List all application entry points and dependency declarations that pull in the `mcp` package from PyPI.
- Check the current version of mcp installedRun `pip show mcp` or check your requirements file, lockfile, or container image. Record which version you have.
- Upgrade mcp to the fixed versionIf you use version 1.9.1 to 1.29.1, upgrade to 1.30.0 or later. If you use version 2.0.0 to 2.1.1, upgrade to 2.2.0 or later. Use your package manager to pull the new version (for example, `pip install --upgrade mcp==2.2.0` or update your requirements file and redeploy).
- Add the issuer parameter to ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProviderFind all places in your code where you create `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider`. Add the `issuer=` parameter with the URL of your legitimate authorization server (for example, `issuer="https://auth.example.com"`). This binds the credentials to that server so they cannot be redirected.
- Review OAuthClientProvider usageIf you use `OAuthClientProvider` (the interactive provider), the upgrade alone fixes the issue. No additional parameter changes are required, but verify that sign-in still works correctly in your testing.
- Test the fix in a staging environmentDeploy the upgraded SDK and your code changes to a staging environment. Trigger OAuth flows for each credential provider you use. Confirm that tokens are still issued and that the client can access the protected resource. Check that deprecation warnings appear for any `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider` instances that do not have an `issuer=` parameter (you should have fixed these in step
- Check logs for signs of past misuseSearch your authorization server logs and MCP server logs for suspicious token requests or unusual issuer values in the period before you applied this fix. Look for token requests from unexpected IP addresses or with unusual scope or client claims. If found, revoke affected tokens and credentials immediately.
- Deploy to production and monitorRoll out the upgraded SDK and code changes to production. Monitor OAuth and token endpoint logs for the first week. If you see any sign of credential misuse (unexpected token requests, failed authentications with valid credentials), initiate your incident response plan.
How to confirm it is fixed: Confirm the fix by upgrading to the stated version, adding `issuer=` parameters to ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider instances, testing an OAuth flow in staging, and checking that the client sends credentials only to the authorized
SecurityElites Quick Fixes: copy and paste
Upgrade mcp with pipupgrade
pip install --upgrade "mcp>=2.2.0"
pip show mcp | grep VersionPin it in requirements.txtupgrade
mcp>=2.2.0Check installed mcp versionfor this issue
pip show mcp | grep VersionExample fix: ClientCredentialsOAuthProvider with issuer bindingfor this issue
from mcp.client.auth import ClientCredentialsOAuthProvider
# BEFORE (vulnerable):
# provider = ClientCredentialsOAuthProvider(...)
# AFTER (fixed):
provider = ClientCredentialsOAuthProvider(
client_id="your_client_id",
client_secret="your_client_secret",
issuer="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-115563) 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 - mcp (PyPI): 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.
Ticket for your backlog
Paste into Jira, GitHub Issues or any tracker that reads Markdown.
Ready-made ticket
## MCP SDK sends OAuth secrets to wrong server if the server says so (CVE-2026-115563)
**Severity:** High | **SE Fix-First Score:** 43/100 | **Fix window:** Within 30 days
**Record:** SE-AIV-01159 https://securityelites.com/ai-vulnerabilities/cve-2026-115563-mcp-sdk-sends-oauth-secrets-to-wrong-server-if/
### Why this matters
A malicious or compromised MCP server can steal OAuth client secrets, authorization codes, and signing keys meant for a legitimate authorization server. An attacker could use these credentials to impersonate the client and access protected resources or user data on the real authorization server.
### What to do
1. Find where the MCP SDK is installed: Search your codebase for imports of `mcp.client.auth` or usage of `OAuthClientProvider`, `ClientCredentialsOAuthProvider`, `PrivateKeyJWTOAuthProvider`, or `RFC7523OAuthClientProvider`. List all application entry points and dependency declarations that pull in the `mcp` package from PyPI.
2. Check the current version of mcp installed: Run `pip show mcp` or check your requirements file, lockfile, or container image. Record which version you have.
3. Upgrade mcp to the fixed version: If you use version 1.9.1 to 1.29.1, upgrade to 1.30.0 or later. If you use version 2.0.0 to 2.1.1, upgrade to 2.2.0 or later. Use your package manager to pull the new version (for example, `pip install --upgrade mcp==2.2.0` or update your requirements file and redeploy).
4. Add the issuer parameter to ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider: Find all places in your code where you create `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider`. Add the `issuer=` parameter with the URL of your legitimate authorization server (for example, `issuer="https://auth.example.com"`). This binds the credentials to that server so they cannot be redirected.
5. Review OAuthClientProvider usage: If you use `OAuthClientProvider` (the interactive provider), the upgrade alone fixes the issue. No additional parameter changes are required, but verify that sign-in still works correctly in your testing.
6. Test the fix in a staging environment: Deploy the upgraded SDK and your code changes to a staging environment. Trigger OAuth flows for each credential provider you use. Confirm that tokens are still issued and that the client can access the protected resource. Check that deprecation warnings appear for any `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider` instances that do not have an `issuer=` parameter (you should have fixed these in step
7. Check logs for signs of past misuse: Search your authorization server logs and MCP server logs for suspicious token requests or unusual issuer values in the period before you applied this fix. Look for token requests from unexpected IP addresses or with unusual scope or client claims. If found, revoke affected tokens and credentials immediately.
8. Deploy to production and monitor: Roll out the upgraded SDK and code changes to production. Monitor OAuth and token endpoint logs for the first week. If you see any sign of credential misuse (unexpected token requests, failed authentications with valid credentials), initiate your incident response plan.
### Done when
- [ ] mcp is at 2.2.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Confirm the fix by upgrading to the stated version, adding `issuer=` parameters to ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider instances, testing an OAuth flow in staging, and checking that the client sends credentials only to the authorized
- [ ] 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.
Related vulnerabilities
The same kind of mistake in other AI tools
- vLLM API lets any client crash the server with huge image requests High · CVE-2026-114055
Change history
- 19 Nov 2026: Made public
- 1 Dec 2026: Published
Official record
### Summary In affected versions, the SDK's OAuth client support (`mcp.client.auth`) let the MCP server a client connected to decide where the client's OAuth credentials were sent:- the authorization server metadata `issuer` was not validated on every discovery path, and - stored or pre-provisioned client credentials were not bound to the authorization server they belong to.A malicious or compromised MCP server could therefore direct them to a token endpoint of its choosing:- by naming its own authorization server in its protected resource metadata, or - by publishing none and serving metadata that presents the user's real authorization server as the `issuer`.It would then receive the `client_secret`, authorization code and PKCE `code_verifier` meant for that real server (or, with `PrivateKeyJWTOAuthProvider`, a signed client assertion).### Am I affected? Yes, if both of these hold:- your application uses the SDK as an MCP client over HTTP with `OAuthClientProvider`, `ClientCredentialsOAuthProvider`, `PrivateKeyJWTOAuthProvider` or the deprecated 1.x `RFC7523OAuthClientProvider` as the transport's `auth` handler; - it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization server (a pre-provisioned secret or signing key, or a stored client registration).Affected versions:- 1.9.1 through 1.29.1: no `issuer` check and no credential binding on any path. - 2.0.0 through 2.1.1: both missing whenever the server publishes no protected resource metadata (the legacy fallback) or answers `403 insufficient_scope`. - Both lines, on every path: `ClientCredentialsOAuthProvider` and `PrivateKeyJWTOAuthProvider` had no way to name the authorization server their credentials belong to.Not affected:- MCP servers built with the SDK - stdio clients - clients that attach their own tokens or headersThe rating is scored for the unattended providers. With the interactive `OAuthClientProvider` a person has to start the sign-in; scored that way it is 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`).### Fix Upgrade to `mcp` 2.2.0 (2.x) or 1.30.0 (1.x) or later.If you use `ClientCredentialsOAuthProvider` or `PrivateKeyJWTOAuthProvider`, upgrading changes nothing until you also pass `issuer=` (for example `issuer="https://auth.example.com"`):- Without it they still follow whichever authorization server the MCP server advertises. - Omitting it now emits a deprecation warning, and it becomes required in 3.0. On 1.30.0 it is a `DeprecationWarning`, which Python hides by default. - The deprecated 1.x `RFC7523OAuthClientProvider` has no `issuer` option. Move to one of these two providers.In the fixed versions the client also:- works out which issuer it expects before fetching any authorization server metadata, on every path; - refuses metadata whose `issuer` differs, with `OAuthFlowError`; - binds stored registrations to that issuer, and discards one bound to a different issuer so the client registers again.After upgrading:- **Stored registrations:** a registration stored without an issuer stays unbound. That includes everything 1.x stored before 1.30.0. Clear stored OAuth client information once so the client registers again. If you placed a pre-registered client in storage yourself, set `issuer` on that record instead. - **Past exposure:** if such a client may have connected to an untrusted MCP server, rotate its client secret and revoke its tokens at the authorization server.On earlier versions there is no workaround other than connecting OAuth-enabled clients only to MCP servers you trust.
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-115563For 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 20 Nov 2026. Read the vendor advisory before changing a production system.