What's Happening?
A significant security vulnerability has been identified in Claude Code, an agentic system, which allows attackers to steal OAuth tokens through a method known as MCP hijacking. This vulnerability, discovered by Mitiga Labs, involves redirecting the output,
including OAuth tokens, to an attacker's infrastructure before it reaches its intended destination. The attack is executed by modifying the MCP configuration and OAuth tokens stored in the ~/.claude.json file. This man-in-the-middle attack enables the attacker to gain access to all tools connected to Claude Code, effectively using the OAuth token as a master key. The attack is stealthy and persistent, as it can bypass multi-factor authentication and remain undetected by the user.
Why It's Important?
The discovery of this vulnerability highlights the critical security risks associated with agentic systems like Claude Code, which are increasingly used by developers. The ability to steal OAuth tokens undetected poses a significant threat to data security, as these tokens can grant access to sensitive information and systems. This issue underscores the importance of robust security measures and monitoring to protect against such vulnerabilities. The potential impact is broad, affecting any organization or individual using Claude Code, as attackers can exploit this vulnerability to gain unauthorized access to connected tools and data.
What's Next?
Organizations using Claude Code are advised to monitor configuration changes and suspicious activity closely. Mitiga Labs suggests that users should not wait for a solution from Anthropic, the company behind Claude Code, as they have deemed the issue 'out of scope.' Instead, users should proactively implement security measures to detect and mitigate potential attacks. This includes monitoring OAuth refresh behavior and unexpected traffic through MCP integrations. The broader cybersecurity community may also push for more stringent security protocols and updates to prevent similar vulnerabilities in the future.












