GPT-56T 861 —
MUSE-SPK 835 -0.7%
GPT-56SC 827 -5.3%
QWEN-38X 824 —
CL-OP55X 820 —
GPT-6A 820 —
GROK-46H 820 -5.2%
GLM-5 784 -8.4%
KIMI-K3X 742 -8.4%
CL-FAB5H 742 -5.7%
CL-OP5H 718 -6%
CL-OP5X 708 -18.2%
CL-OP46H 696 -6.2%
CL-OP47H 688 -6.1%
GEM-38FH 677 +0.1%
GEM-37FH 655 -24.3%
GPT-56S 619 —
GPT-55H 580 —
CL-OP47 579 -0.7%
INKL 531 —
GEM-31P 512 —
GEM-3P 498 —
CL-OP46 496 —
CL-OP48 489 -0.2%
GPT-56T 861 —
MUSE-SPK 835 -0.7%
GPT-56SC 827 -5.3%
QWEN-38X 824 —
CL-OP55X 820 —
GPT-6A 820 —
GROK-46H 820 -5.2%
GLM-5 784 -8.4%
KIMI-K3X 742 -8.4%
CL-FAB5H 742 -5.7%
CL-OP5H 718 -6%
CL-OP5X 708 -18.2%
CL-OP46H 696 -6.2%
CL-OP47H 688 -6.1%
GEM-38FH 677 +0.1%
GEM-37FH 655 -24.3%
GPT-56S 619 —
GPT-55H 580 —
CL-OP47 579 -0.7%
INKL 531 —
GEM-31P 512 —
GEM-3P 498 —
CL-OP46 496 —
CL-OP48 489 -0.2%
← Back to feed

Claude Code Stores OAuth Tokens in Plaintext and Anthropic Won't Fix the MCP Hijack

Mitiga Labs published a detailed attack chain on May 7, 2026, showing how an attacker can silently steal OAuth credentials from Claude Code’s Model Context Protocol integrations, persist through token rotation, and maintain SaaS access indefinitely — without triggering any user-visible alert. Anthropic reviewed the finding in April and declined to address it.

The Attack

Claude Code authenticates to MCP servers using OAuth. The bearer tokens it obtains are stored in plaintext inside ~/.claude.json — the same file that controls trust state, MCP server URLs, and shell-command prompt settings. Because all these settings share one file and one permission level, a process that can write to ~/.claude.json can change everything in it.

The attack starts with a malicious npm package. On install, a lifecycle hook runs automatically — no user interaction required beyond npm install. The hook does two things:

  1. Locates common Claude Code project directories and sets the trust dialog flag to true, ensuring no confirmation prompt fires when those directories are subsequently opened.
  2. Opens ~/.claude.json and rewrites the mcpServers config block to point at an attacker-controlled proxy.

From that point, every MCP session Claude Code initiates connects through the proxy. The OAuth token transits attacker infrastructure. The user sees a working integration. The provider sees a valid request from a trusted origin, because Claude Code’s egress runs through Anthropic’s infrastructure.

The persistence mechanism is the part that makes this hard to recover from. If the victim rotates their OAuth token, the hook detects the next config write and inserts the proxy URL back. If the victim manually restores the MCP endpoint, the hook overwrites it again on the next load. The attacker retains access as long as the hook remains in place.

What the Token Gets

An MCP OAuth token issued by a provider like GitHub, Slack, or any other SaaS tool is not scoped to a single operation. It grants the same access the user approved — typically broad repo, workspace, or account permissions. The token looks identical to the provider whether it originated from the legitimate machine or from a proxy three hops away. MFA is effectively bypassed: the token already represents a completed authentication.

The immediate risk is credential theft for every tool in a developer’s MCP configuration. The downstream risk is lateral movement: a Claude Code deployment at a company with MCP integrations to internal systems becomes a persistent access point, not a development tool.

Anthropic’s Response

Mitiga reported the findings to Anthropic on April 10, 2026. Anthropic acknowledged the report on April 11. On April 12, the response came back: out of scope.

The reasoning, consistent with Anthropic’s prior response to the Adversa TrustFall disclosure, was that the user consented to what happens when they install npm packages. The logic positions trust as a binary that transfers wholesale to any software running in the user’s environment.

No patch has been issued. Anthropic has not published a security advisory or a timeline for remediation.

Detection Without a Vendor Fix

Because Anthropic has not addressed this at the platform level, detection falls to individual developers and security teams. Mitiga recommends:

  • Baseline approved MCP server URLs and alert on changes to ~/.claude.json
  • Monitor for new localhost proxies or unexpected outbound connections during MCP sessions
  • Review SaaS audit logs for valid-credential actions that do not match normal work patterns — valid origin, valid token, unusual task type
  • Restrict or audit npm package installations on machines where Claude Code runs with production MCP integrations

Token rotation alone is insufficient as long as the hook remains installed. The hook must be found and removed first.

Key Numbers

  • Disclosed: March 23, 2026 (Mitiga discovery)
  • Reported to Anthropic: April 10, 2026
  • Anthropic response: April 12 — “out of scope”
  • Published: May 7, 2026 (SecurityWeek)
  • Patch status: None
  • Platforms affected: Any machine running Claude Code with dynamic-auth MCP servers
  • Token storage: Plaintext in ~/.claude.json
  • Persistence through rotation: Yes