Protecting OAuth Tokens from Stealthy Manipulated Client Protocol Attacks
OAuth Token Hijacking Threatens Developers’ Security
Mitiga Labs has discovered a critical vulnerability in Claude Code, an agentic system designed for developers, which enables attackers to steal OAuth tokens with ease.
- The vulnerable system stores OAuth tokens in plain text within the user’s local configuration file (~/.claude.json).
- An attacker who gains access to this file can redirect the tokens to their own infrastructure, bypassing multi-factor authentication (MFA) and gaining unauthorized access to sensitive resources.
Once the attacker has established control over the traffic flow, they can use the OAuth token to access any tool or service connected to Claude Code, including those with high-security clearances.
- The victim remains unaware of the attack, as the modifications made to their local configuration file are done quietly and without raising any red flags.
Mitiga Labs reported its discovery to Claude Code developer Anthropic, but the company deemed the issue “out of scope,” citing that the user had already consented to the potential risks.
To mitigate this risk, Mitiga recommends that users monitor their Claude Code configuration changes, MCP server URL changes, OAuth refresh behavior, suspicious SaaS API activity, and unexpected traffic through MCP integrations.
- This proactive approach can help identify potential attacks before they escalate into full-blown security breaches.
As the world becomes increasingly dependent on agentic systems like Claude Code, it is essential to prioritize security and vigilance.
