7.7high
Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions
- Severity
- 7.7high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.39% (higher than 34% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-mhg7-666j-cqg4
Description
Claude Code is an agentic coding tool. Prior to version 2.0.55, 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. This issue has been patched in version 2.0.55.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| anthropics claude-code | < 2.0.55 | CVE List |
| @anthropic-ai/claude-code (npm) | before 2.0.55 | GitHub Advisory Database |
| anthropic claude_code | before 2.0.55 | NVD |
All scores
| GitHub_M | 7.7high CVSS:4.0 | 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 |
| GitHub | high CVSS:4.0 | 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 |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
Classification
What each source says
CVE List
Claude Code is an agentic coding tool. Prior to version 2.0.55, 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. This issue has been patched in version 2.0.55.
GitHub Advisory Database
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!
NVD (es)
Claude Code es una herramienta de codificación agéntica. Antes de la versión 2.0.55, Claude Code no validaba correctamente los comandos que utilizaban operaciones sed canalizadas con el comando echo, permitiendo a los atacantes eludir las restricciones de escritura de archivos. Esta vulnerabilidad permitía la escritura en directorios sensibles como la carpeta .claude y rutas fuera del alcance del proyecto. La explotación de esto requería la capacidad de ejecutar comandos a través de Claude Code con la función 'aceptar ediciones' habilitada. Este problema ha sido parcheado en la versión 2.0.55.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-25723 changed 2026-02-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mhg7-666j-cqg4 changed 2026-02-06 | CC-BY-4.0 |
| NVD | CVE-2026-25723 changed 2026-06-17 | Public domain |