STUPID-2026-0073
Symlink-hijack lets a booby-trapped repo overwrite config in Claude Code, Gemini CLI, Cursor, Copilot CLI, Grok Build and Codex (SymJack)
Instruction given
Normal repository work — the user approves what appears to be a routine file-copy operation inside a cloned repository.
Expected behavior
A file-copy operation the user approves should write only to the path shown in the approval prompt; the agent's own configuration should not be reachable by a copy the user believed was scoped to project files.
Actual behavior
A pre-committed symlink inside the repository redirects the approved copy operation to the agent's own config path (e.g. .claude/settings.json, .mcp.json, .codex/config.toml). The approval dialog shows the harmless apparent destination, not the resolved symlink target, so the user's approval does not cover what actually gets overwritten. On next agent startup the hijacked config can register an attacker-controlled MCP server that runs arbitrary commands.
Damage
Security researchers at Adversa AI built working proof-of-concept exploits against six agents: Claude Code, Gemini CLI, Cursor Agent CLI, GitHub Copilot CLI, Grok Build CLI, and Codex Agent. Anthropic added security warnings to Claude Code's approval flow for sensitive directories after the report; the other vendors declined the report or classified it as out-of-scope, leaving the technique unpatched in those tools at time of publication.
Classification
- Agent
- Multiple Agents
- Failure mode
- Security Vulnerability
- Root cause
- Other
- Domain
- Security
- Source
- Security Research