STUPID-2026-0107
Claude Code's git worktree handling let a malicious repo escape the sandbox via symlink and fsmonitor tricks, overwriting shell init files (CVE-2026-55607)
Instruction given
N/A — this is a flaw in Claude Code's own sandbox and git-worktree handling, not a task a user asked the agent to perform. It triggers simply from cloning a malicious repository and running Claude Code against it.
Expected behavior
Claude Code's seatbelt sandbox should confine all file writes and command execution triggered by git operations to the project workspace, regardless of what a repository's own worktrees, symlinks, or git configuration attempt to do — so that opening an untrusted repo cannot cause files to be written outside the sandbox.
Actual behavior
Versions >= 2.1.38 and < 2.1.163 allowed creation of a git worktree literally named ".git", producing git-directory confusion. Combined with symlink manipulation and triggering of git's fsmonitor during worktree operations inside a specially crafted repository containing prompt injection content, an attacker-controlled worktree could be navigated to a location outside the sandbox and used to overwrite a shell initialization file (e.g. ~/.zshenv) in the user's home directory.
Damage
Overwriting the user's shell init file gave an attacker unsandboxed, arbitrary code execution the next time a shell started, with full confidentiality, integrity, and availability impact (CVSS v4.0 7.7, High: AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H). Exploitation required the user to clone a malicious repository and run Claude Code against it. Reported by security researcher metnew via HackerOne; fixed in Claude Code 2.1.163, with users on standard auto-update receiving the fix automatically.
Classification
- Agent
- Claude Code
- Failure mode
- Security Vulnerability
- Root cause
- Other
- Domain
- Security
- Source
- Security Research
Related incidents
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.
This database is callable over MCP — query it from inside your agent.