GitHub Advisoryadvisory · npm

GHSA-mhg7-666j-cqg4 Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions

HIGH Published 2026-02-06 Modified 2026-02-06 Official page ↗
Aliases
CVE-2026-25723
Ecosystem
npm
Packages
@anthropic-ai/claude-code
Severity
High
CVSS 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, CWE-78
Reviewed
2026-02-06

Affected packages

• npm @anthropic-ai/claude-code: < 2.0.55 → fixed in 2.0.55

Description

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!

Related

Alias · CVE (1)

Weakness · CWE (2)

  • CWE-20 Improper Input Validation weakness
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command weakness

References