CVE-2026-123271: ChatCLI OAuth Flaw Allows Token Theft via Malicious MCP Servers

ChatCLI versions before v1.215.2 contain an origin validation vulnerability in the MCP OAuth login flow that allows malicious servers to obtain and replay user bearer tokens against other resources on the same authorization server.

Christopher Ort
By Christopher Ort · 2 min read
Share
A security researcher examining authentication flow diagrams on a computer screen in a dimly lit office
On this page
  1. Vulnerability Overview
  2. Technical Details
  3. Exploitation Requirements
  4. Affected Versions
  5. Patch Information
  6. Remediation Steps
  7. Credit
  8. Sources

Vulnerability Overview

ChatCLI versions 1.159.0 through 1.215.1 contain a high-severity origin validation error (CVE-2026-123271) in the Model Context Protocol (MCP) OAuth login flow. The vulnerability allows a malicious or compromised MCP server to obtain OAuth bearer tokens intended for other resources and replay them against those resources.

Technical Details

When a user logs in to a remote MCP server using the `/mcp login` command or the `@mcp-login` tool, ChatCLI accepted the `resource` member from the Protected Resource Metadata served by the MCP server without performing the identity check required by RFC 9728 section 3.3. The application used this server-supplied resource value as the RFC 8707 resource indicator in the authorization request, code exchange, stored OAuth metadata, and every token refresh.

A malicious MCP server could declare a different resource served by the same authorization server. After the user completed consent, ChatCLI would send the resulting token—audience-bound to that other resource—to the MCP server as its bearer credential. The server could then replay this token against the other resource.

Additional issues identified in the vulnerable code include:

  • The `resource_metadata` URL from the server’s WWW-Authenticate challenge was followed on any origin
  • Discovery documents were read without size limits
  • The SSE transport accepted a messages endpoint on any origin and sent server credentials there

Exploitation Requirements

Successful exploitation requires several conditions:

  • A malicious or compromised MCP server
  • An authorization server that supports dynamic client registration and honors the requested resource indicator
  • A second resource of that authorization server that accepts the token
  • The user completing the consent flow

Affected Versions

ChatCLI versions 1.159.0 through 1.215.1 are affected by this vulnerability.

Patch Information

The vulnerability is fixed in ChatCLI version 1.215.2, released on October 11, 2026. The patch implements multiple security improvements:

  • The canonical URL of the configured MCP server is now the only resource indicator used
  • Protected resource metadata naming another resource is refused
  • The `resource_metadata` URL is followed only on the server’s own origin
  • Discovery and registration documents are capped at 1 MiB
  • Credentials stored by affected versions for another resource are never sent and require a new login
  • The SSE transport confines the messages endpoint to the server’s origin
  • MCP transports refuse cross-origin and downgrading redirects
  • Authorization server metadata must name its issuer per RFC 8414 section 3.3 and use HTTPS endpoints

Remediation Steps

Users should upgrade to ChatCLI version 1.215.2 immediately. After upgrading, users who logged in to an untrusted MCP server should:

1. Run `/mcp logout ` for the affected server

2. Revoke the ChatCLI client at the authorization server

As a workaround for users unable to upgrade immediately, only log in to MCP servers that are trusted.

Credit

This vulnerability was reported by Theodoros Lampropoulos (@GimmyDatBeeR).

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