Browse / Tool and Agent Misuse / CVE-2026-25723
Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions
- Class
- Tool and Agent Misuse (filed by a model that read the advisory)
- Technique
- Path traversal and file access
- Affected
- @anthropic-ai/claude-code (npm)
- Gets past
- Path restriction
- 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.4% chance of exploitation in 30 days
How it works, in short
A piped sed command built with echo got past Claude Code's command validation, letting an agent in accept-edits mode write to protected paths such as .claude and outside the project. (Our summary, written by a model. The source text is below.)
Details
Claude Code failed to properly validate commands using piped sed operations with the echo command, allowing attackers to bypass file write restrictions. This vulnerability enabled writing to sensitive directories like the .claude folder and paths outside the project scope. Exploiting this required the ability to execute commands through Claude Code with the "accept edits" feature enabled.
Users on standard Claude Code auto-update received this fix automatically. Users performing manual updates are advised to update to the latest version.
Claude Code thanks hackerone.com/nil221 for reporting this issue!
References
- https://github.com/anthropics/claude-code/security/advisories/GHSA-mhg7-666j-cqg4
- https://nvd.nist.gov/vuln/detail/CVE-2026-25723
- https://github.com/anthropics/claude-code
Source: GitHub Advisory Database, used under CC BY 4.0.