CVE-2026-123272: Token Theft Vulnerability in mcp-go OAuth Client Allows Malicious Servers to Obtain Credentials for Other Resources

A high-severity vulnerability in Mark3labs mcp-go OAuth client before version 1.2.1 allows malicious MCP servers to declare arbitrary resources in metadata and obtain access tokens intended for other servers.

Christopher Ort
By Christopher Ort · 3 min read
Share
Security researcher examining OAuth authentication flow diagrams on a computer screen in a dimly lit office
On this page
  1. Vulnerability Overview
  2. Technical Details
  3. Affected Versions
  4. Patch Details
  5. Mitigation Recommendations
  6. Additional Context
  7. Sources

Vulnerability Overview

A high-severity security vulnerability tracked as **CVE-2026-123272** has been disclosed in the Mark3labs mcp-go OAuth client library. The flaw, which affects versions v0.48.0 through v1.2.0, allows malicious Model Context Protocol (MCP) servers to obtain OAuth access tokens intended for other resources by exploiting improper validation in the `OAuthHandler.fetchServerMetadata` function.

The vulnerability carries a CVSS score of 8.0 and was reported privately by security researcher Theodoros Lampropoulos (@GimmyDatBeeR).

Technical Details

The vulnerability stems from insufficient validation when the OAuth client fetches Protected Resource Metadata (RFC 9728) from the well-known path of an MCP server. According to the GitHub security advisory, the client failed to apply RFC 9728 section 3.3 validation checks to metadata retrieved from the well-known path, though these checks were correctly applied to metadata advertised through WWW-Authenticate headers.

When connecting to an MCP server, the OAuth client would:

  • Fetch Protected Resource Metadata from the server’s well-known path
  • Accept the declared resource identifier without validation
  • Use this unvalidated resource as the RFC 8707 resource parameter in:

– Dynamic client registration

– Authorization requests

– Token exchange operations

– Token refresh operations

Attack Scenario

A malicious or compromised MCP server could exploit this flaw by declaring a different MCP server as its resource identifier in the metadata. The OAuth client would then request an access token for that victim server from the authorization server. The attacker’s server would receive this token and could replay it against the victim resource, effectively stealing credentials intended for another service.

As stated in the commit message: “A resource that does not bind to the addressed MCP server is rejected instead of being used as the RFC 8707 resource indicator.”

Affected Versions

  • **Vulnerable**: mcp-go versions v0.48.0 through v1.2.0
  • **Patched**: mcp-go version v1.2.1 and later

Patch Details

The fix was implemented in commit 90d247e and released in version v1.2.1 on October 9, 2026. The patch introduces validation of the declared resource against the addressed resource when fetching metadata from the well-known path.

According to the pull request #1053, the fix implements a binding check that requires:

  • Same scheme and host (case-insensitive comparison)
  • Matching query, fragment, and userinfo components
  • Path equal to or a segment-aware prefix of the addressed path
  • Trailing slashes are ignored

The validation is intentionally designed to be slightly looser for well-known paths than for advertised paths, allowing servers mounted at paths like `/mcp` that declare their origin as the resource to continue functioning. However, any resource naming a different server is now rejected with the error message: “protected resource metadata from %q declares resource %q which does not match base URL %q”.

When a mismatch is detected, the metadata is not used, preventing the OAuth client from making registration or token requests with the malicious resource identifier.

Mitigation Recommendations

Organizations using mcp-go should take the following actions:

1. **Upgrade immediately** to mcp-go version v1.2.1 or later

2. Review logs for any suspicious OAuth token requests that may indicate exploitation attempts

3. Audit MCP server connections to ensure only trusted servers are configured

4. Consider rotating OAuth credentials if exploitation is suspected

Additional Context

The vulnerability affects the OAuth client transport component of mcp-go, specifically the code in `client/transport/oauth.go`. The fix includes comprehensive test coverage in `oauth_prm_resource_binding_test.go` to verify that mismatched resources are properly rejected and that legitimate OAuth flows continue to function correctly.

No evidence of active exploitation has been reported in the public sources at the time of disclosure.

Sources

Christopher Ort

Christopher Ort

Christopher Ort handles SEO, AI agent workflows and PR & partnerships at i10x.ai, the all-in-one AI workspace built by i10X Global Pte. Ltd. in Singapore. He is a graduate of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU). He is the author of “The Style Penalty”, a study published on SSRN that analyses 1,576 evaluation decisions by four frontier AI models to show how AI-written CVs fare in automated hiring screens; the research has been covered by heise online and t3n.

Editor's picks

  1. CVE-2026-77604: Path Traversal Vulnerability in Code Graph RAG MCP Server Allows Arbitrary File Read
  2. CVE-2026-123271: ChatCLI OAuth Flaw Allows Token Theft via Malicious MCP Servers
  3. CVE-2026-123022: AgentScope MCP Workspace Allows Unauthenticated Remote Code Execution
  4. CVE-2026-97677: Path Traversal Flaw in IBM Langflow OSS 1.0.0–1.12.2 Allows File Read/Write
  5. Active Support DoS Flaw Lets Unauthenticated Attackers Crash Rails Servers via Action Cable