{"question":"Our Go MCP client uses the mark3labs/mcp-go OAuth transport to sign users in to remote MCP servers. What are CVE-2026-123272 and the similar ChatCLI CVE-2026-123271, which versions fix them, and what should any MCP client check before it asks for a token?","slug":"can-a-malicious-mcp-server-get-your-oauth-token-for-a-different-mcp-server-mcp-go-cve-2026-123272","url":"https://www.rightshold.com/answers/can-a-malicious-mcp-server-get-your-oauth-token-for-a-different-mcp-server-mcp-go-cve-2026-123272","short_answer":"Yes, with an affected client. mcp-go v0.48.0 through v1.2.0 (advisory GHSA-xf6j-693p-wqxx, published by the maintainers on October 9, 2026; CVE-2026-123272 published in NVD on November 5) read the Protected Resource Metadata (RFC 9728) an MCP server serves at its well-known path and used the resource it declared, unchecked, as the RFC 8707 resource indicator in client registration, the authorization request, the token exchange and token refresh. A malicious or compromised server could declare a different MCP server that uses the same authorization server: after the user consented, the authorization server issued a token for that other server, the client sent it to the malicious server as its bearer token, and that server could replay it against the other one. mcp-go v1.2.1 (October 9) fixes it by refusing metadata whose resource doesn't bind to the server address you configured; v1.5.0 was the newest release on November 15, 2026. ChatCLI had the same flaw from 1.159.0 through 1.215.1 (GHSA-95vg-3r9c-2v5q, CVE-2026-123271), fixed in 1.215.2 on October 11. The rule for every MCP client is in the spec: the resource parameter is the canonical URI of the server you meant to use, not whatever that server says it is.","checklist":["Check go.mod: github.com/mark3labs/mcp-go v0.48.0 through v1.2.0 are affected. Upgrade to v1.2.1 or later (v1.5.0 was the newest on November 15, 2026) and rebuild every binary that embeds it; a library fix only reaches users in a new build.","If you use ChatCLI, upgrade to 1.215.2 or later (1.230.0 was the newest on November 15, 2026). Its advisory says that if you logged in to an MCP server you don't trust, run /mcp logout <server> after upgrading and revoke the ChatCLI client at the authorization server.","If you wrote your own MCP OAuth client, set the resource parameter from the server URL you configured (its canonical URI: scheme, host, port and path, no fragment), never from the resource field of metadata the server returns.","Compare the resource in Protected Resource Metadata with the server you addressed and don't use the metadata if they don't match. RFC 9728 section 3.3 requires this both for the well-known path and for a resource_metadata URL taken from WWW-Authenticate.","Follow a resource_metadata URL only on the MCP server's own origin and cap the size of discovery documents, as ChatCLI's fix now does (1 MiB).","Don't keep sending tokens an affected version stored. ChatCLI's fix never attaches a credential recorded for another resource and asks for a new login; clear or re-check tokens your own client saved before the upgrade.","If you run MCP servers behind one authorization server, have each server accept only tokens whose audience is its own canonical URI, and check whether a single consent can be used to issue tokens for any resource registered there.","Show the user which MCP server a sign-in is for before they consent. The attack needs the user to complete consent."],"sections":[{"heading":"What CVE-2026-123272 in the mcp-go OAuth client does","points":["mcp-go's OAuth client transport finds out how to authorize by fetching the MCP server's Protected Resource Metadata (RFC 9728), either from a resource_metadata URL in the server's WWW-Authenticate challenge or from the well-known path built from the server URL. The maintainers' advisory says the RFC 9728 section 3.3 check, that the declared resource identifies the server the client addressed, was applied only to the first case. On the well-known path, the declared resource went unchecked into the RFC 8707 resource parameter of dynamic client registration, the authorization request, the token exchange and token refresh.","So a malicious or compromised MCP server could name another MCP resource in its metadata. The client asked the authorization server for a token for that other resource, and the server it was actually talking to received the token and could forward it. The advisory lists v0.48.0 through v1.2.0 as affected and says the issue was reported privately.","The CVE record (CVE-2026-123272, assigned by VulnCheck and published in NVD on November 5, 2026) gives it CVSS 3.1 8.0 (AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N): it needs the user to sign in and an authorization server that serves both resources, and the token it leaks works on a different server from the one that receives it."]},{"heading":"How mcp-go v1.2.1 and ChatCLI 1.215.2 fix the resource indicator","points":["The mcp-go fix (commit 90d247ed, PR #1053, released as v1.2.1 on October 9, 2026) applies the binding check to metadata from the well-known path too. Metadata advertised through WWW-Authenticate must declare a resource exactly equal to the server URL and is refused if the field is missing. Well-known metadata may declare the URL itself or a parent path at a segment boundary on the same scheme and host, so a server at https://host/mcp that declares https://host keeps working, while metadata naming another host is refused and not used.","ChatCLI's advisory (CVE-2026-123271, versions 1.159.0 through 1.215.1, fixed in 1.215.2 on October 11) describes the same flaw in its /mcp login command and @mcp-login tool. Its fix makes the canonical URL of the configured server the only resource indicator, follows resource_metadata only on the server's own origin, caps discovery documents, and never sends a credential stored for another resource again. The same release confines the SSE messages endpoint to the server's origin, refuses cross-origin and downgrading redirects, and requires authorization server metadata to name its issuer and use https endpoints.","The ChatCLI advisory spells out what the attack needs: a malicious or compromised MCP server, an authorization server that supports dynamic client registration and honours the requested resource indicator, a second resource on that authorization server that accepts the token, and the user completing consent. One company authorization server in front of several internal MCP servers is the setup to check first."]},{"heading":"What every MCP client should do with the resource parameter","points":["The MCP authorization specification (2026-07-28) says the resource parameter MUST be included in both authorization requests and token requests, MUST identify the MCP server the client intends to use the token with, and MUST use that server's canonical URI as defined in RFC 8707. Its examples of valid canonical URIs include https://mcp.example.com/mcp and https://mcp.example.com; a URI with a fragment isn't valid.","RFC 9728 section 3.3 says the resource value in Protected Resource Metadata MUST be identical to the resource identifier the well-known URL was built from or, when the metadata URL came from WWW-Authenticate, to the URL the client requested, and that otherwise the data MUST NOT be used. Treat metadata as input from the server: use it to find the authorization server, and take the resource from your own configuration.","Server-side audience checks still matter, but they don't stop this on their own: the leaked token really was issued for the other server, so that server's audience check accepts it. Audience checks on servers and a fixed resource indicator on clients work only together."]}],"checks":[],"ask_rightshold":{"start":"https://www.rightshold.com/start?ref=seo","mcp_endpoint":"https://www.rightshold.com/mcp","ask":"Before my MCP client completes a first OAuth sign-in for a new server, ask the account owner to approve it with the server URL, the resource indicator the client will send and the authorization server in the request, so a sign-in for a different resource can't go ahead unnoticed.","mcp_call":{"tool":"request_human_approval","arguments":{"action":{"tool":"mcp oauth sign-in","mcp_server":"https://mcp.example.com/mcp","resource_indicator":"https://mcp.example.com/mcp","authorization_server_issuer":"https://auth.example.com"},"summary":"First OAuth sign-in for MCP server https://mcp.example.com/mcp; resource indicator equals the configured server URL","expires_in_minutes":30}},"also":["Needs a key for your account. It hashes the action details and returns an approval id and a one-time token for the owner. Only the account owner can decide it, with an account key; delegated agent keys are refused, so the assistant can't approve its own request. Anyone can check the signed decision free with verify_human_approval, including that the server, resource indicator and issuer match what was approved.","It doesn't read OAuth metadata, check your mcp-go or ChatCLI version, compare the approved resource indicator with what your client actually sends, or see any token. Upgrade, and set the resource parameter from your own configuration."],"scope":"Rightshold isn't affiliated with the mcp-go or ChatCLI projects, VulnCheck or any authorization server vendor. It records approvals your agent asks it for; it doesn't scan client code, hold OAuth tokens or detect token replay. Advisory details are as published by the mcp-go and ChatCLI maintainers on GitHub, CVE details as shown in GitHub's advisory database and NVD, and spec text is from the MCP 2026-07-28 authorization page and RFC 9728, all read November 15, 2026. Advisories get updated, so confirm fixed versions on the linked pages before you upgrade."},"sources":[{"title":"mcp-go: GHSA-xf6j-693p-wqxx, OAuth client accepts an unvalidated resource from well-known Protected Resource Metadata (CVE-2026-123272)","url":"https://github.com/mark3labs/mcp-go/security/advisories/GHSA-xf6j-693p-wqxx"},{"title":"mcp-go PR #1053: validate resource in well-known protected resource metadata (released in v1.2.1)","url":"https://github.com/mark3labs/mcp-go/pull/1053"},{"title":"GitHub Advisory Database: GHSA-h3x9-8c36-m89w / CVE-2026-123272","url":"https://github.com/advisories/GHSA-h3x9-8c36-m89w"},{"title":"ChatCLI: GHSA-95vg-3r9c-2v5q, MCP OAuth login uses the server-supplied protected resource as the RFC 8707 resource indicator (CVE-2026-123271)","url":"https://github.com/diillson/chatcli/security/advisories/GHSA-95vg-3r9c-2v5q"},{"title":"MCP specification 2026-07-28: Authorization (resource parameter and canonical server URI)","url":"https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization"},{"title":"IETF: RFC 9728, OAuth 2.0 Protected Resource Metadata (section 3.3)","url":"https://www.rfc-editor.org/rfc/rfc9728"},{"title":"IETF: RFC 8707, Resource Indicators for OAuth 2.0","url":"https://www.rfc-editor.org/rfc/rfc8707"}],"related":[{"title":"MCP OAuth wrong-audience tokens: what they are and how to defend","url":"https://www.rightshold.com/answers/mcp-oauth-wrong-audience-tokens"},{"title":"Can a malicious MCP server steal your OAuth refresh token or client secret?","url":"https://www.rightshold.com/answers/can-a-malicious-mcp-server-steal-your-oauth-refresh-token-or-client-secret"},{"title":"Should an MCP server still support Dynamic Client Registration, or switch to Client ID Metadata Documents?","url":"https://www.rightshold.com/answers/should-an-mcp-server-still-support-dynamic-client-registration-or-switch-to-client-id-metadata-documents"},{"title":"OAuth token exchange (OBO) so MCP servers never forward user tokens","url":"https://www.rightshold.com/answers/how-to-do-oauth-token-exchange-so-an-mcp-server-never-forwards-user-tokens"}],"computed_from":"Curated guidance; license verdicts computed from Rightshold's license profiles at render time. Not legal advice.","updated":"2026-11-15"}