Executive brief
Claude Code is an IDE extension that allows AI-assisted code generation and editing. A command injection vulnerability allows attackers who can trigger edits through Claude Code to bypass file write restrictions and write to sensitive directories like .claude folders or paths outside the project scope, potentially compromising code integrity and sensitive configuration.
Technical details
Claude Code failed to properly validate and sanitize commands using piped sed operations combined with the echo command, allowing injection of arbitrary shell commands. An attacker must have the ability to execute commands through Claude Code with the "accept edits" feature enabled (requires user interaction to accept the malicious edits). This vulnerability allows writing to directories that should be protected, bypassing intended file write restrictions. The vulnerability affects versions prior to 2.0.55 and was patched in v2.0.55. Attack vector is network-based via the Claude Code extension.
Affected products
- Anthropic Claude Code < v2.0.55
Timeline
- 2026-02-06: disclosed
- 2026-02-06: patched: Fixed in version 2.0.55