{"id":"CVE-2026-104850","kind":"vulnerability","aliases":["CVE-2026-104850","GHSA-6qxp-vccf-f47h"],"related":[],"title":"MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server","description":"### Summary\nIn 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.\n\nA malicious or compromised MCP server could name its own authorization server. With no user interaction, the client would send it:\n\n- the `refresh_token` and `client_secret` stored from an earlier sign-in\n- the `client_secret` or signed assertion configured on a bundled provider\n\n### Am I affected?\nYes, if both of these hold:\n\n- your application uses the SDK's OAuth client over HTTP, through any of:\n    - an `authProvider` on a transport\n    - the `withOAuth()` middleware\n    - direct calls to `auth()` or `fetchToken()`\n- it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization server\n\nAffected versions:\n\n- `@modelcontextprotocol/sdk` 1.12.0 through 1.30.1\n- `@modelcontextprotocol/client` 2.0.0 through 2.1.0, only for:\n    - bundled providers without `expectedIssuer`\n    - credentials stored or supplied without `issuer`\n    - direct calls to `fetchToken()`\n    - providers that read storage back through `OAuthTokensSchema` or `OAuthClientInformationSchema`\n\nNot affected:\n\n- MCP servers built with the SDK\n- stdio clients\n\n### Fix\nUpgrade to:\n\n- 1.x: `@modelcontextprotocol/sdk` 1.31.0 or later\n- 2.x: `@modelcontextprotocol/client` 2.2.0 or later, and `@modelcontextprotocol/core` 2.2.0 or later if you import it directly\n\nThe 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.\n\nIn the following cases, upgrading to the patched version is not enough. You also need to make a change:\n\n- **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.\n- **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.\n- **Your own `OAuthClientProvider`:** save exactly what `saveTokens()` and `saveClientInformation()` are given, including `issuer`. For pre-registered credentials, include `issuer` in what `clientInformation()` returns.\n\nNot covered by this fix:\n\n- a new interactive sign-in, which still goes to the authorization server the MCP server names. Only complete sign-ins for servers you trust.\n- `refreshAuthorization()` and `exchangeAuthorization()` called directly\n- 2.x with `skipIssuerMetadataValidation: true`\n\nIf an affected client may have connected to an untrusted MCP server, rotate its client secret or signing key and revoke its tokens.\n\nIf you cannot upgrade yet, connect OAuth clients only to MCP servers you trust. 2.0.0 and 2.1.0 already accept `expectedIssuer`.","summary":"The MCP TypeScript SDK's OAuth client let the MCP server choose which authorization server receives the client's saved refresh tokens and client secrets. A malicious or compromised MCP server can thus collect those credentials without any user interaction.","severity":"high","cvss":7.5,"epss":0.00282,"exploited":false,"exploited_at":null,"products":[{"name":"@modelcontextprotocol/sdk","fixed":["1.31.0"],"affected":">= 1.12.0, < 1.31.0","ecosystem":"npm"},{"name":"@modelcontextprotocol/client","fixed":["2.2.0"],"affected":">= 2.0.0, < 2.2.0","ecosystem":"npm"}],"ecosystems":["npm"],"tags":["ai-tooling","cwe-345","cwe-522","mcp","node.js","oauth","typescript"],"not_affected_if":["mcp-servers-only","stdio-clients","trusted-servers-only"],"how_to_check":"- Check the installed version: `npm ls @modelcontextprotocol/sdk @modelcontextprotocol/client`\n- Look for OAuth use over HTTP: an `authProvider` on a transport, `withOAuth()`, or direct calls to `auth()` or `fetchToken()`\n- For 2.x, check whether bundled providers (`ClientCredentialsProvider`, `PrivateKeyJwtProvider`, `StaticPrivateKeyJwtProvider`, `CrossAppAccessProvider`) lack `expectedIssuer`","fix":"- `@modelcontextprotocol/sdk`: `1.31.0` or later (affected 1.12.0 through 1.30.1)\n- `@modelcontextprotocol/client`: `2.2.0` or later (affected 2.0.0 through 2.1.0), and `@modelcontextprotocol/core` `2.2.0` or later if imported directly\n- Bundled providers also need `expectedIssuer`; credentials saved without `issuer` need it added or need clearing","status":"open","published_at":"2026-09-30T20:59:40+00:00","first_seen_at":"2026-11-09T22:53:24+00:00","triaged_at":"2026-11-09T22:59:22+00:00","updated_at":"2026-11-09T22:59:22+00:00","category":"ai-tooling","confidence":0.9,"triage":{"at":"2026-11-09T22:59:22Z","model":"claude-haiku-5-5","output":{"fix":"- `@modelcontextprotocol/sdk`: `1.31.0` or later (affected 1.12.0 through 1.30.1)\n- `@modelcontextprotocol/client`: `2.2.0` or later (affected 2.0.0 through 2.1.0), and `@modelcontextprotocol/core` `2.2.0` or later if imported directly\n- Bundled providers also need `expectedIssuer`; credentials saved without `issuer` need it added or need clearing","reach":"internet","title":"MCP TypeScript SDK: OAuth client sends credentials to any named authorization server","impact":"high","summary":"The MCP TypeScript SDK's OAuth client let the MCP server choose which authorization server receives the client's saved refresh tokens and client secrets. A malicious or compromised MCP server can thus collect those credentials without any user interaction.","audience":"developers","category":"ai-tooling","nicknames":[],"who_cares":["mcp","typescript","node.js","oauth"],"confidence":0.9,"fix_status":"available","needs_auth":"no","worst_case":"Refresh tokens and client secrets are sent to an attacker-chosen authorization server","analyst_note":"","how_to_check":"- Check the installed version: `npm ls @modelcontextprotocol/sdk @modelcontextprotocol/client`\n- Look for OAuth use over HTTP: an `authProvider` on a transport, `withOAuth()`, or direct calls to `auth()` or `fetchToken()`\n- For 2.x, check whether bundled providers (`ClientCredentialsProvider`, `PrivateKeyJwtProvider`, `StaticPrivateKeyJwtProvider`, `CrossAppAccessProvider`) lack `expectedIssuer`","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["stdio-clients","mcp-servers-only","trusted-servers-only"],"who_is_affected":"Applications that use the SDK's OAuth client over HTTP and may connect to MCP servers that are not fully trusted while holding credentials for a legitimate authorization server. MCP servers built with the SDK and stdio clients are not affected. Upgrading is not enough on its own for bundled providers without `expectedIssuer` and for credentials stored without `issuer`.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.001002,"input_tokens":5891,"output_tokens":826,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-104850':20A,28A '-2026':19A,27A '-345':35B '-522':37B '1':265C,378C '1.12.0':220C '1.30.1':222C '1.31.0':268C,382C '2':271C,467C '2.0.0':224C,509C '2.1.0':226C,511C '2.2.0':274C,279C '6qxp':23A 'accept':513C 'add':395C 'affect':84C,163C,217C,253C,474C 'ai':32B 'ai-tool':31B 'alreadi':512C 'also':330C 'applic':171C 'assert':155C 'auth':194C 'auth.example.com':347C 'author':11A,55B,97C,111C,126C,215C,292C,354C,388C,447C 'authprovid':184C 'back':247C 'belong':114C 'built':256C 'bundl':159C,229C,336C 'call':192C,240C,315C,465C 'cannot':497C 'case':320C 'chang':335C 'choos':53B 'chosen':13A 'clear':400C 'client':5A,48B,59B,65B,90C,101C,133C,141C,151C,177C,261C,288C,366C,475C,486C,502C 'clientcredentialsprovid':338C 'clientinform':429C 'collect':75B 'complet':454C 'compromis':70B,119C 'configur':156C 'connect':199C,478C,500C 'could':6A,122C 'cover':432C 'credenti':8A,77B,104C,105C,211C,233C,298C,360C,424C 'crossappaccessprovid':341C 'cve':18A,26A 'cwe':34B,36B 'databas':373C 'decid':95C 'differ':306C 'direct':191C,239C,286C,466C 'earlier':146C 'enough':328C 'everyth':377C 'exact':411C 'exampl':345C 'exchangeauthor':464C 'expectedissu':232C,343C,346C,514C 'f47h':25A 'fetchtoken':196C,242C 'file':371C 'first':393C 'fix':262C,435C 'follow':319C 'fulli':207C 'ghsa':22A 'ghsa-6qxp-vccf-f47h':21A 'given':417C 'go':385C 'goe':444C 'hold':169C,210C 'http':179C 'import':284C 'in':457C 'includ':376C,418C,425C 'inform':367C 'interact':81B,131C,438C 'issuer':238C,295C,363C,396C,419C,426C 'key':490C 'keychain':372C 'later':270C,276C,281C 'legitim':214C 'let':49B,91C 'make':333C 'malici':68B,117C 'may':198C,476C 'mcp':1A,16A,38B,43B,51B,71B,93C,120C,202C,254C,357C,450C,482C,505C 'middlewar':190C 'modelcontextprotocol/client':30A,223C,273C 'modelcontextprotocol/core':278C 'modelcontextprotocol/sdk':29A,219C,267C 'name':123C,359C,391C,452C 'need':331C 'new':437C 'node.js':39B 'oauth':4A,40B,47B,89C,103C,176C,501C 'oauthclientinformationschema':251C 'oauthclientprovid':369C,409C 'oauthtokensschema':249C 'one':307C 'pass':342C 'patch':324C 'persist':370C 'pre':422C 'pre-regist':421C 'privatekeyjwtprovid':339C 'provid':160C,230C,243C,337C 'read':245C 'receiv':57B,99C 'record':290C 'refresh':62B,138C 'refreshauthor':462C 'regist':423C 'return':430C 'revok':492C 'rotat':484C 'save':61B,297C,361C,380C,410C 'saveclientinform':415C 'savetoken':413C 'sdk':3A,45B,87C,174C,259C 'secret':66B,142C,152C,487C 'send':7A,135C,302C 'server':12A,17A,52B,56B,72B,94C,98C,112C,121C,127C,203C,216C,255C,293C,355C,358C,389C,448C,451C,459C,483C,506C 'sign':148C,154C,310C,404C,440C,456C,489C 'sign-in':147C,439C,455C 'skipissuermetadatavalid':470C 'staticprivatekeyjwtprovid':340C 'stdio':260C 'still':351C,384C,443C 'storag':246C 'store':143C,234C 'summari':82C 'suppli':236C 'throw':316C 'thus':74B 'tie':108C 'token':63B,139C,364C,494C 'tool':33B 'transport':187C 'true':471C 'trust':208C,461C,508C 'typescript':2A,41B,44B 'untrust':481C 'upgrad':263C,321C,375C,498C 'use':172C,352C,394C 'user':80B,130C,309C,403C 'vccf':24A 'version':85C,218C,325C 'whichev':353C,387C 'withoauth':189C 'without':78B,231C,237C,348C,362C 'would':134C 'x':266C,272C,379C,468C 'yes':164C 'yet':499C","nicknames":[],"mitigations":[],"who_affected":"Applications that use the SDK's OAuth client over HTTP and may connect to MCP servers that are not fully trusted while holding credentials for a legitimate authorization server. MCP servers built with the SDK and stdio clients are not affected. Upgrading is not enough on its own for bundled providers without `expectedIssuer` and for credentials stored without `issuer`.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["client","sdk"],"ptokens":["client","modelcontextprotocol","sdk"],"labels":["aitooling","cwe345","cwe522","high","mcp","nodejs","npm","oauth","typescript"],"campaign_type":null,"search_a":"'-104850':20A,28A '-2026':19A,27A '6qxp':23A 'author':11A 'chosen':13A 'client':5A 'could':6A 'credenti':8A 'cve':18A,26A 'f47h':25A 'ghsa':22A 'ghsa-6qxp-vccf-f47h':21A 'mcp':1A,16A 'modelcontextprotocol/client':30A 'modelcontextprotocol/sdk':29A 'oauth':4A 'sdk':3A 'send':7A 'server':12A,17A 'typescript':2A 'vccf':24A","search_b":"'-345':35B '-522':37B 'ai':32B 'ai-tool':31B 'author':55B 'choos':53B 'client':48B,59B,65B 'collect':75B 'compromis':70B 'credenti':77B 'cwe':34B,36B 'interact':81B 'let':49B 'malici':68B 'mcp':38B,43B,51B,71B 'node.js':39B 'oauth':40B,47B 'receiv':57B 'refresh':62B 'save':61B 'sdk':45B 'secret':66B 'server':52B,56B,72B 'thus':74B 'token':63B 'tool':33B 'typescript':41B,44B 'user':80B 'without':78B","search_c":"'1':265C,378C '1.12.0':220C '1.30.1':222C '1.31.0':268C,382C '2':271C,467C '2.0.0':224C,509C '2.1.0':226C,511C '2.2.0':274C,279C 'accept':513C 'add':395C 'affect':84C,163C,217C,253C,474C 'alreadi':512C 'also':330C 'applic':171C 'assert':155C 'auth':194C 'auth.example.com':347C 'author':97C,111C,126C,215C,292C,354C,388C,447C 'authprovid':184C 'back':247C 'belong':114C 'built':256C 'bundl':159C,229C,336C 'call':192C,240C,315C,465C 'cannot':497C 'case':320C 'chang':335C 'clear':400C 'client':90C,101C,133C,141C,151C,177C,261C,288C,366C,475C,486C,502C 'clientcredentialsprovid':338C 'clientinform':429C 'complet':454C 'compromis':119C 'configur':156C 'connect':199C,478C,500C 'could':122C 'cover':432C 'credenti':104C,105C,211C,233C,298C,360C,424C 'crossappaccessprovid':341C 'databas':373C 'decid':95C 'differ':306C 'direct':191C,239C,286C,466C 'earlier':146C 'enough':328C 'everyth':377C 'exact':411C 'exampl':345C 'exchangeauthor':464C 'expectedissu':232C,343C,346C,514C 'fetchtoken':196C,242C 'file':371C 'first':393C 'fix':262C,435C 'follow':319C 'fulli':207C 'given':417C 'go':385C 'goe':444C 'hold':169C,210C 'http':179C 'import':284C 'in':457C 'includ':376C,418C,425C 'inform':367C 'interact':131C,438C 'issuer':238C,295C,363C,396C,419C,426C 'key':490C 'keychain':372C 'later':270C,276C,281C 'legitim':214C 'let':91C 'make':333C 'malici':117C 'may':198C,476C 'mcp':93C,120C,202C,254C,357C,450C,482C,505C 'middlewar':190C 'modelcontextprotocol/client':223C,273C 'modelcontextprotocol/core':278C 'modelcontextprotocol/sdk':219C,267C 'name':123C,359C,391C,452C 'need':331C 'new':437C 'oauth':89C,103C,176C,501C 'oauthclientinformationschema':251C 'oauthclientprovid':369C,409C 'oauthtokensschema':249C 'one':307C 'pass':342C 'patch':324C 'persist':370C 'pre':422C 'pre-regist':421C 'privatekeyjwtprovid':339C 'provid':160C,230C,243C,337C 'read':245C 'receiv':99C 'record':290C 'refresh':138C 'refreshauthor':462C 'regist':423C 'return':430C 'revok':492C 'rotat':484C 'save':297C,361C,380C,410C 'saveclientinform':415C 'savetoken':413C 'sdk':87C,174C,259C 'secret':142C,152C,487C 'send':135C,302C 'server':94C,98C,112C,121C,127C,203C,216C,255C,293C,355C,358C,389C,448C,451C,459C,483C,506C 'sign':148C,154C,310C,404C,440C,456C,489C 'sign-in':147C,439C,455C 'skipissuermetadatavalid':470C 'staticprivatekeyjwtprovid':340C 'stdio':260C 'still':351C,384C,443C 'storag':246C 'store':143C,234C 'summari':82C 'suppli':236C 'throw':316C 'tie':108C 'token':139C,364C,494C 'transport':187C 'true':471C 'trust':208C,461C,508C 'untrust':481C 'upgrad':263C,321C,375C,498C 'use':172C,352C,394C 'user':130C,309C,403C 'version':85C,218C,325C 'whichev':353C,387C 'withoauth':189C 'without':231C,237C,348C,362C 'would':134C 'x':266C,272C,379C,468C 'yes':164C 'yet':499C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-09-30T20:59:40+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa-repo","external_id":"GHSA-6qxp-vccf-f47h","url":"https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-6qxp-vccf-f47h","severity":"high","published_at":"2026-09-30T20:59:40+00:00","modified_at":"2026-10-02T16:21:20+00:00","first_seen_at":"2026-11-09T22:53:24+00:00","fetched_at":"2026-11-09T22:53:24+00:00","note":null},{"source":"ghsa","external_id":"GHSA-6qxp-vccf-f47h","url":"https://github.com/advisories/GHSA-6qxp-vccf-f47h","severity":"high","published_at":"2026-10-06T15:35:44+00:00","modified_at":"2026-10-06T15:35:44+00:00","first_seen_at":"2026-11-09T22:57:50+00:00","fetched_at":"2026-11-09T22:57:50+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-104850","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104850","severity":null,"published_at":"2026-10-06T17:17:15+00:00","modified_at":"2026-10-06T20:03:40+00:00","first_seen_at":"2026-11-09T23:10:12+00:00","fetched_at":"2026-11-09T23:10:12+00:00","note":null}],"documents":[{"id":110608,"url":"https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-6qxp-vccf-f47h","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa-repo","publisher":"vendor","text":null,"published_at":"2026-09-30T20:59:40+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"},{"id":110900,"url":"https://api.github.com/repos/modelcontextprotocol/typescript-sdk/security-advisories/GHSA-6qxp-vccf-f47h","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":110902,"url":"https://github.com/modelcontextprotocol/typescript-sdk/pull/2887","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":110903,"url":"https://github.com/modelcontextprotocol/typescript-sdk/commit/edd12e282620ebf770d67316f19cf91d4112a1bd","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":110904,"url":"https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v2.2.0","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.00282,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-104850"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}