Executive brief
Claude Code is a code generation and execution tool developed by Anthropic. A flaw in its directory validation logic allows attackers to bypass write protections on sensitive folders by using directory change commands, potentially enabling unauthorized file creation or modification within protected directories. Exploitation requires an attacker to inject malicious commands into a Claude Code session.
Technical details
Claude Code failed to properly validate directory changes when combined with write operations to protected folders. The vulnerability exists in command injection via directory traversal: an attacker can use the `cd` command to navigate into sensitive directories like `.claude` and then bypass write protection mechanisms, creating or modifying files without user confirmation. Attack vector is network-based with low complexity; exploitation requires user interaction (passive—the user must include untrusted content in the Claude Code context window). Successful exploitation results in confidentiality, integrity, and availability impact to the vulnerable system. The vulnerability was patched in version 2.0.57; users on auto-update received fixes automatically.
Affected products
- Anthropic Claude Code before 2.0.57
Timeline
- 2026-02-06: disclosed
- 2026-02-06: patched: version 2.0.57