CVE-2026-25723

Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions

Published Feb 6, 2026 CVSS 4.0 · 7.7 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

Claude Code, an agentic coding tool, contains a command injection flaw that fails to validate piped sed commands combined with an echo statement. Attackers who can trigger the tool's "accept edits" capability can inject arbitrary shell commands, enabling them to write malicious content to restricted directories such as the .claude folder or to paths outside the defined project scope. The flaw directly compromises data integrity and could be used to deploy further code, leading to a high impact on confidentiality and integrity in the host environment.

Affected Systems

Anthropics' Claude Code versions earlier than 2.0.55, including deployments running on Node.js environments, are vulnerable. The issue affects all installations where the "accept edits" feature is enabled and the tool is exposed to potentially untrusted input streams.

Risk and Exploitability

CVSS score 7.7 indicates high severity, while the EPSS score of less than 1% suggests limited exploitation probability currently. The vulnerability is not present in CISA's KEV catalog. Exploitation requires that the attacker can supply input to Claude Code's accept edits function, which in typical deployments is limited to authenticated users. Nevertheless, once the condition is met, the attacker can bypass file write restrictions and place arbitrary files, which could be leveraged for further attacks.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the official patch by upgrading to Claude Code 2.0.55 or newer.
  • If an upgrade is not immediately possible, disable the "accept edits" feature to prevent the injection vector.
  • Monitor repository and file system logs for unexpected writes to the .claude directory or other protected paths to detect potential exploitation.

Generated by OpenCVE AI on April 17, 2026 at 22:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-mhg7-666j-cqg4 Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions
History
Type Values Removed Values Added
First Time appeared Anthropic
Anthropic claude Code
CPEs cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:*
Vendors & Products Anthropic
Anthropic claude Code
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N'}

Type Values Removed Values Added
First Time appeared Anthropics
Anthropics claude Code
Vendors & Products Anthropics
Anthropics claude Code
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions
Weaknesses CWE-20
CWE-78
References
Metrics cvssV4_0

{'score': 7.7, 'vector': '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'}

Weaknesses
  • CWE-20

    Improper Input Validation

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Feb 6, 2026, 6:40 PM
Reserved
Feb 5, 2026, 4:48 PM
Status
Analyzed
Published
Feb 6, 2026, 6:15 PM
Modified
Jun 17, 2026, 10:25 AM