The vulnerability, CVE-2026-104850, stems from the MCP TypeScript SDK's OAuth client not binding credentials to a specific authorization server. A malicious or compromised MCP server could exploit this by specifying its own authorization server during the OAuth discovery process. The client would then unknowingly send sensitive credentials, such as refresh_token, client_secret, or signed JWT assertions, to the attacker's server.
The analysis of the patch commits reveals several key vulnerable areas:
-
Direct API Calls: The fetchToken and auth functions in packages/client/src/client/auth.ts were primary entry points. Before the patch, they lacked checks to verify that the authorization server they were interacting with matched the issuer for which the credentials were valid. The patch introduces explicit AuthorizationServerMismatchError throws in these functions.
-
Bundled Providers: The constructors of ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider, and CrossAppAccessProvider in packages/client/src/client/authExtensions.ts were vulnerable. If instantiated without an expectedIssuer property, they would create provider instances that were not tied to any specific authorization server, making them susceptible to the attack. The fix involves deprecating the omission of expectedIssuer and adding warnings.
-
Credential Storage: The OAuthTokensSchema and OAuthClientInformationSchema in packages/core/src/auth.ts previously stripped the issuer field when parsing stored credentials. This meant that even if the issuer was saved, it would be lost on the next read, effectively unbinding the credentials and re-introducing the vulnerability for any provider that relied on these schemas for storage operations.
The root cause was a failure to enforce the binding between a set of credentials and their intended authorization server throughout the authentication and token management lifecycle. The identified vulnerable functions are the direct points in the code where this lack of validation could be triggered to leak credentials.