CVE-2026-25723
JSON

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 packageVersionsReported by
anthropics claude-code< 2.0.55CVE List
@anthropic-ai/claude-code (npm)before 2.0.55GitHub Advisory Database
anthropic claude_codebefore 2.0.55NVD

All scores

GitHub_M7.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Classification

CWE-20CWE-78

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

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

SourceRecordLicence
CVE ListCVE-2026-25723 changed 2026-02-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-mhg7-666j-cqg4 changed 2026-02-06CC-BY-4.0
NVDCVE-2026-25723 changed 2026-06-17Public domain