CVE-2026-25722 Claude Code Vulnerable to Command Injection via Directory Change Bypasses Write Protection
HighCVSS 7.7
EPSS 0.51%
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
Description
Claude Code is an agentic coding tool. Prior to version 2.0.57, Claude Code failed to properly validate directory changes when combined with write operations to protected folders. By using the cd command to navigate into sensitive directories like .claude, it was possible to bypass write protection and create or modify files without user confirmation. Reliably exploiting this required the ability to add untrusted content into a Claude Code context window. This issue has been patched in version 2.0.57.
Upgrade path
3 packages: 2 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| Anthropic claude code | < 2.0.57 | 2.0.57 | Fixed |
| anthropic-ai @anthropic-ai/claude-code(npm) | < 2.0.57 | 2.0.57 | Fixed |
| anthropics claude-code | = < 2.0.57 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| anthropics claude-code | = < 2.0.57 | No fix listed |
| anthropic-ai @anthropic-ai/claude-code(npm) | < 2.0.57 | 2.0.57 |
| Anthropic claude code | < 2.0.57 | 2.0.57 |
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-66q4-vfjg-2qhh vendor-advisory
- nvd.nist.gov third-party-advisory vendor-advisory
- github.com
- github.com product