CVE-2026-25722: Claude Code Vulnerable to Command Injection via Directory Change Bypasses Write Protection
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!
Other sources
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.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-25722?
CVE-2026-25722 is considered a high severity vulnerability due to its potential for command injection via directory changes.
How do I fix CVE-2026-25722?
To fix CVE-2026-25722, update to Claude Code version 2.0.57 or later, where the vulnerability has been addressed.
What are the potential impacts of CVE-2026-25722?
The potential impacts of CVE-2026-25722 include unauthorized access to sensitive directories and execution of arbitrary commands.
Which versions of Claude Code are affected by CVE-2026-25722?
CVE-2026-25722 affects all versions of Claude Code prior to version 2.0.57.
Is there a workaround for CVE-2026-25722?
There are no specified workarounds for CVE-2026-25722; updating to the latest version is recommended for mitigation.