MCP SDK sends OAuth credentials to wrong server if it is tricked
What this means
An attacker who runs or compromises an MCP server you connect to can receive your OAuth client secrets, authorization codes, or signed assertions meant for your real login server. This lets them impersonate your application, access data the application can reach, or take over accounts. The attack is silent: no error or warning alerts you.
SecurityElites Manager Brief: the decision in one minute
A malicious MCP server can trick the SDK into sending login credentials to the attacker instead of the real authorization server. If your code connects to servers you don't fully control and uses OAuth, credentials could be stolen. Update the SDK and check whether you use the affected OAuth providers.
| 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 and deploys the application or service using the MCP SDK. |
| Likely effort | About 30 minutes per application: update the SDK, add the issuer parameter if you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, test the connection, and check logs for past suspicious activity. Effort rises if you manage many applications o |
Questions to ask your team or supplier
- Which of our applications use the mcp SDK and which OAuth providers do they use? Do we have a complete list and have we tested the upgrade?
- Of those applications, which ones connect to MCP servers outside our direct control, and do those servers belong to trusted third parties or could they be compromised?
- If we use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, have we added the issuer parameter to each one, and have we tested that the application still works?
Message you can forward to the owning team
Security notice: MCP SDK sends OAuth credentials to wrong server if it is tricked (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-credentials-to-wrong-server-if/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-01159What is at stake in your AI setup
- OAuth credentials and signing keys used by the application can be stolen and used to access the authorization server and downstream APIs
- API tokens obtained via OAuth can be intercepted, allowing an attacker to impersonate the application and access or modify data it has permission to reach
- If the application connects to AI provider APIs or retrieval systems, stolen credentials could grant access to models, training data, or query history
Who is exposed
- Teams running applications that use mcp 2.0.0–2.1.1 with any OAuth provider and connect to external or untrusted MCP servers
- Teams running applications that use mcp 1.9.1–1.29.1 with any OAuth provider and connect to external or untrusted MCP servers
- Services using ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider without an issuer parameter (even after upgrade)
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 to MCP servers you do not fully trust or control. If you must, isolate the connection to a separate credential set (a different client ID and secret or signing key) that has minimal permissions and is m
- If you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider and cannot upgrade yet, manually validate the issuer field in the server's metadata before connecting and reject any connection that claims a different issuer than expe
Signs it may already have been used against you
- In your authorization server logs: token requests with client credentials or codes originating from IP addresses or at times that don't match your application's normal behavior or geographic location
- In your application logs: OAuth failures or unexpected token refresh attempts, especially if the application did not initiate them or if they target the wrong authorization server
- In network flow or firewall logs: outbound connections from your application to unknown or unexpected HTTP endpoints when OAuth flows are active, particularly to servers that are not your configured authorization server
- In your MCP server logs: unusual metadata or issuer fields in requests, or serving metadata that claims a different authorization server than what your application expects
SecurityElites Fix Guide: step by step
- Find where mcp is installedCheck each application and service that uses the Model Context Protocol SDK. Look in requirements.txt, pyproject.toml, setup.py, poetry.lock, or pip show mcp. Write down the installed version and which applications have it.
- Check if you use the affected OAuth providersSearch your codebase for imports and use of OAuthClientProvider, ClientCredentialsOAuthProvider, PrivateKeyJWTOAuthProvider, or RFC7523OAuthClientProvider. If you don't use any of these, you are not at risk from this issue. If you do, note where they are used and what version of mcp is installed there.
- Check if you connect to untrusted serversFor each use of an affected OAuth provider, verify whether the MCP server is one you fully control and trust (for example, your own service on your own infrastructure), or whether you connect to external servers, third-party services, or servers where others can run code. If you only connect to your own trusted servers, the risk is lower but not zero.
- Upgrade mcp to the fixed versionUpdate mcp to version 2.2.0 or later (if using 2.x) or 1.30.0 or later (if using 1.x). Follow your application's standard upgrade process: update the version pin in your dependency file, install, test locally, and deploy.
- Add the issuer parameter if you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthPrIf your code uses ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, add the issuer parameter with the full URL of your real authorization server (for example issuer="https://auth.example.com"). Without this, the provider still accepts any server the MCP server claims is the issuer. Omitting it now produces a deprecation warning.
- Test the connection after upgradeDeploy the updated code to a test environment and verify that your application can still connect to the MCP server and authenticate. Check that OAuth flows complete and tokens are obtained. If the connection fails, check application logs for error messages about issuer validation.
- Check logs for past misuseReview authentication and API logs from your authorization server and application for the period before this upgrade was deployed. Look for unusual token requests, failed or successful logins from unexpected places, API calls that don't match normal patterns, or tokens claimed by the MCP server you use. If you find suspicious activity, treat it as a potential credential breach: revoke affected credentials and tokens,
- Review other applications using mcpIf your organization uses mcp in other applications, repeat these steps for each one to ensure they are all upgraded and configured securely.
How to confirm it is fixed: Confirm the installed version of mcp is 2.2.0 or later (or 1.30.0 or later for 1.x), and if you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, verify that the issuer parameter is supplied with the authorization server URL and no deprecation
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 VersionRead 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 credentials to wrong server if it is tricked (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-credentials-to-wrong-server-if/
### Why this matters
An attacker who runs or compromises an MCP server you connect to can receive your OAuth client secrets, authorization codes, or signed assertions meant for your real login server. This lets them impersonate your application, access data the application can reach, or take over accounts. The attack is silent: no error or warning alerts you.
### What to do
1. Find where mcp is installed
2. Check if you use the affected OAuth providers
3. Check if you connect to untrusted servers
4. Upgrade mcp to the fixed version
5. Add the issuer parameter if you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthPr
6. Test the connection after upgrade
7. Check logs for past misuse
8. Review other applications using mcp
Full steps: https://securityelites.com/ai-vulnerabilities/cve-2026-115563-mcp-sdk-sends-oauth-credentials-to-wrong-server-if/
### 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 installed version of mcp is 2.2.0 or later (or 1.30.0 or later for 1.x), and if you use ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider, verify that the issuer parameter is supplied with the authorization server URL and no deprecation
- [ ] 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
- Langflow OSS can leak secrets and private data through improper input validation High · CVE-2026-115549
- NLTK can read files outside a corpus when symlinks are present High · CVE-2026-126304
- MCP servers over HTTP accept unlimited request sizes, causing memory exhaustion High · GHSA-f897-62hf-6gxq
- vLLM multimodal API can be forced to exhaust memory and crash High · CVE-2026-114055
- Model Context Protocol servers can run out of memory from large requests High · CVE-2026-111768
Change history
- 19 Nov 2026: Made public
- 1 Dec 2026: Published
- 3 Dec 2026: Guide updated
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 4 Dec 2026. Read the vendor advisory before changing a production system.