MCP SDK OAuth Clients Could Send Credentials to a Server-Chosen Authorization Server

Your agent holds a client secret for a real authorization server, and it connects to an MCP server. Which of the two decides where that secret goes? On affected versions of the official MCP SDKs, the MCP server could. The Python and TypeScript advisories published this week say so in their titles, and bumping the version does not finish the job.
| At a glance | Python SDK | TypeScript SDK |
|---|---|---|
| Identifier | GHSA-qx49-fqc8-xw99 | GHSA-6qxp-vccf-f47h |
| Affected | mcp >= 1.9.1, < 1.30.0 and >= 2.0.0a1, < 2.2.0 | @modelcontextprotocol/sdk >= 1.12.0, < 1.31.0; @modelcontextprotocol/client >= 2.0.0, < 2.2.0 |
| Fixed in | 1.30.0, 2.2.0 | sdk 1.31.0, client 2.2.0 |
| Severity | 7.5 High (CVSS 3.1) in the project's GitHub advisory, no separate scorer named | 7.5 High (CVSS 3.1) in the project's GitHub advisory, no separate scorer named |
| Exploited as of 2026-09-30 | No public report found; not in CISA KEV | No public report found; not in CISA KEV |
| Disclosed | 2026-09-28; fix released 2026-09-07 | 2026-09-30; fix released 2026-09-28 |
Two defects, and not every version has both
The metadata issuer was not always checked. The Python client accepted authorization server metadata without comparing its issuer to the URL the well-known document was built from. The Python advisory says 1.9.1 through 1.29.1 had "no issuer check and no credential binding on any path". Versions 2.0.0 through 2.1.1 lacked both only on the legacy fallback, used when a server publishes no protected resource metadata (PRM), and on a 403 insufficient_scope challenge. The advisory's range starts at 2.0.0a1 while its prose starts at 2.0.0, so treat the pre-releases as affected. The TypeScript advisory does not list this check as a defect, and the two TypeScript lines differ: 1.x does not compare the metadata issuer with the URL it was fetched from, while 2.x throws IssuerMismatchError unless skipIssuerMetadataValidation is set.
Credentials were not bound to an issuer. Both advisories describe this defect. On the 1.x lines, stored or pre-provisioned client IDs, client secrets and refresh tokens carried no record of who issued them, so they went to whichever authorization server the resource advertised next, or on the 2025-03-26 fallback to the resource server's own origin. TypeScript 2.x already had a binding, and its advisory limits 2.x exposure to gaps such as bundled providers without expectedIssuer and credentials stored without issuer. Machine-to-machine providers hold credentials the SDK never obtained, and as TypeScript PR #2887 puts it, "nothing but expectedIssuer says which authorization server they belong to". The Python equivalents had the same gap: ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider "used whichever authorization server discovery produced; nothing else in the flow can say which server issued those credentials", in the words of Python PR #3398.
The Python advisory describes two routes. A malicious or compromised server can name its own authorization server in its PRM. Or it can publish no PRM and serve metadata presenting your real authorization server as issuer, and its token endpoint "would then receive the client_secret, authorization code and PKCE code_verifier meant for that real server". With PrivateKeyJWTOAuthProvider, it gets a signed client assertion.
The TypeScript advisory adds the unattended case: a refresh_token and client_secret from an earlier sign-in, or a bundled provider's secret or assertion, could leave with no user interaction.
The fixes differ too. The Python fix decides the expected issuer before fetching metadata, rejects a mismatch and binds stored registrations to that issuer. The TypeScript fix records the authorization server as issuer on saved credentials and does not send them to a different one, but @modelcontextprotocol/sdk 1.31.0 still does not compare the metadata issuer with the URL it was fetched from.
Are you exposed?
You need all of this: an HTTP MCP client, the SDK's OAuth client, credentials for a legitimate authorization server, and a possible connection to a server you do not fully trust. The Python advisory rules out MCP servers built with the SDK, stdio clients, and clients that attach their own tokens or headers.
My position: if users can add their own MCP server URL to your product, assume you are exposed. If your client only talks to one server you run, your risk is that server being compromised.
What to do now
- Find it. Check lockfiles, not just direct requirements, for
mcp,@modelcontextprotocol/sdkand@modelcontextprotocol/client. - Upgrade. Python to
mcp1.30.0 or 2.2.0. TypeScript to@modelcontextprotocol/sdk1.31.0 or@modelcontextprotocol/client2.2.0, plus@modelcontextprotocol/core2.2.0 if you import it directly. - Pin the issuer on machine-to-machine providers. In Python, pass
issuer="https://auth.example.com"toClientCredentialsOAuthProviderandPrivateKeyJWTOAuthProvider, and move off the deprecatedRFC7523OAuthClientProvider, which has no such option. Omitting it emits a deprecation warning, aDeprecationWarninghidden by default on 1.30.0, and it becomes required in 3.0. In TypeScript, passexpectedIssuer: 'https://auth.example.com'toClientCredentialsProvider,PrivateKeyJwtProvider,StaticPrivateKeyJwtProviderandCrossAppAccessProvider. - Fix what is already stored. Credentials saved before the upgrade stay unbound. In Python, clear stored client information once so the client registers again, or set
issueron records you pre-registered. In TypeScript, addissuerto saved credentials or clear them. A customOAuthClientProvidermust persist exactly whatsaveTokens()andsaveClientInformation()receive, and, per the 1.31.0 release notes, storage that rejects unknown fields must allowissuer. - Rotate where you cannot rule it out. If a client may have met an untrusted server, rotate its client secret or signing key and revoke its tokens. Neither advisory publishes indicators of compromise, so I would rotate rather than hunt.
- Know what the fix leaves open. The TypeScript fix does not cover new interactive sign-ins, direct
refreshAuthorization()andexchangeAuthorization()calls, or 2.x withskipIssuerMetadataValidation: true. Remove that flag, and complete sign-ins only for servers you trust.
If you cannot upgrade yet, connect OAuth clients only to servers you trust. TypeScript 2.0.0 and 2.1.0 can already use expectedIssuer.
After upgrading, Python raises OAuthFlowError with "Authorization server metadata issuer mismatch", and in TypeScript 2.2.0 fetchToken() throws AuthorizationServerMismatchError before sending anything. Investigate that server.
An MCP server is not an identity authority
In one client, this bug is one team's bad week. In the SDK's OAuth client, it is the default for every client built on it, including teams who chose the SDK so they would never have to think about this code.
The design error is about identity between agents and tools. The MCP server is where a credential gets used. It should have no say over where that credential gets sent. A long-lived agent secret already has a home, and the client holding it has to know that home itself.
A version check will not close this one. An SCA finding clears when the version moves, while an unpinned provider and an unbound stored credential remain. Treat issuer and expectedIssuer as configuration you audit, and add them to your MCP security checklist.
Read release notes for auth changes too. The Python change opened as a public hardening PR on 2026-08-26 and shipped on 2026-09-07 described as a behaviour change. The vulnerability label came three weeks later.
Today, open the code that constructs your MCP OAuth provider. Write down which authorization server each credential belongs to, then check that the code enforces it rather than asking the server.
References
- Python advisory GHSA-qx49-fqc8-xw99, Model Context Protocol, 2026-09-28
- TypeScript advisory GHSA-6qxp-vccf-f47h, Model Context Protocol, 2026-09-30
- python-sdk v1.30.0 release, Model Context Protocol, 2026-09-07
- typescript-sdk v2.2.0 release, Model Context Protocol, 2026-09-28
- python-sdk PR #3398, Model Context Protocol, 2026-08-26
- python-sdk PR #3431, v1.x backport, Model Context Protocol, 2026-09-04
- typescript-sdk PR #2887, Model Context Protocol, 2026-09-28
- typescript-sdk 1.31.0 release, Model Context Protocol, 2026-09-28
- typescript-sdk PR #2888, v1.x binding, Model Context Protocol, 2026-09-28
- typescript-sdk 1.31.0 client source, Model Context Protocol, 2026-09-28
- typescript-sdk v2.2.0 client source, Model Context Protocol, 2026-09-28
