Browse / Indirect Prompt Injection / CVE-2026-25722
Claude Code Vulnerable to Command Injection via Directory Change Bypasses Write Protection
- Class
- Indirect Prompt Injection (filed by a model that read the advisory)
- Technique
- Code and command execution
- Also involves
- Tool and Agent Misuse
- Affected
- @anthropic-ai/claude-code (npm)
- Gets past
- Approval or confirmation prompt
- CVSS
- CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- EPSS
- 0.5% chance of exploitation in 30 days
How it works, in short
Untrusted content in context could make Claude Code use a cd command to enter protected directories and write files without the user being asked to confirm. (Our summary, written by a model. The source text is below.)
Details
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.
Users on standard Claude Code auto-update received this fix automatically. Users performing manual updates are advised to update to the latest version.
About
Claude Code thanks hackerone.com/nil221 for reporting this issue!
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-66q4-vfjg-2qhh
- https://nvd.nist.gov/vuln/detail/CVE-2026-25722
- https://github.com/anthropics/claude-code
Source: GitHub Advisory Database, used under CC BY 4.0.