CVE-2026-25722
JSON

7.7high

Claude Code Vulnerable to Command Injection via Directory Change Bypasses Write Protection

Severity
7.7high CVSS:4.0 by GitHub_M
Exploit likelihood
0.51% (higher than 44% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-66q4-vfjg-2qhh

Description

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.

Affected

Product or packageVersionsReported by
anthropics claude-code< 2.0.57CVE List
@anthropic-ai/claude-code (npm)before 2.0.57GitHub Advisory Database
anthropic claude_codebefore 2.0.57NVD

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
NVD9.1critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

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.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.

GitHub Advisory Database

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!

NVD (es)

Claude Code es una herramienta de codificación agéntica. Antes de la versión 2.0.57, Claude Code no validaba correctamente los cambios de directorio cuando se combinaba con operaciones de escritura en carpetas protegidas. Al usar el comando cd para navegar a directorios sensibles como .claude, era posible eludir la protección contra escritura y crear o modificar archivos sin confirmación del usuario. La explotación fiable de esto requería la capacidad de añadir contenido no confiable en una ventana de contexto de Claude Code. Este problema ha sido parcheado en la versión 2.0.57.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-25722 changed 2026-02-06CVE Terms of Use
GitHub Advisory DatabaseGHSA-66q4-vfjg-2qhh changed 2026-02-06CC-BY-4.0
NVDCVE-2026-25722 changed 2026-06-17Public domain