NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Claude Code

CVE-2026-25723: Claude Code Vulnerable to Command Injection via Piped sed Command Bypasses File Write Restrictions

highCVSS 4.0 7.7GHSA-mhg7-666j-cqg4

Claude Code before 2.0.55 did not validate piped `sed` commands combined with `echo`. With "accept edits" enabled, that let a command write to the `.claude` folder and to paths outside the project, bypassing the file write restrictions. Fixed in 2.0.55.

Published Feb 6, 2026 · Analysis Nov 1, 2026

What an attacker can do

In "accept edits" mode, Claude Code allows certain file edit commands without a prompt but restricts where they may write. The check on a pipeline of echo into sed failed to see the real write target. A crafted command of that form could write into sensitive directories such as .claude, or to any path outside the project scope, without the restriction firing.

The advisory says exploitation requires the ability to execute commands through Claude Code with "accept edits" turned on. In practice that means a model steered by a prompt injection in a repository file, web page or tool output, or a user who already has access to the session. The .claude folder holds settings, hooks and commands, and a write outside the project can touch shell startup files or other configs. That is how a file-write bypass becomes code execution later, though the advisory only describes the write bypass. CVSS 4.0 rates it 7.7.

Who is affected

@anthropic-ai/claude-code versions before 2.0.55, when "accept edits" is enabled. Auto-update users received the fix. Manual installs and pinned container images may still run an older build.

claude --version
npm ls -g @anthropic-ai/claude-code

@anthropic-ai/claude-code

Ecosystem
npm
Affected
< 2.0.55
Fixed in
2.0.55
Check
npm ls @anthropic-ai/claude-code

How to fix it

Upgrade to 2.0.55 or later:

npm install -g @anthropic-ai/claude-code@latest

The advisory names no workaround. Until you upgrade, the exposure depends on the "accept edits" setting, so avoid that mode in sessions that read untrusted content.

How to tell if you were hit

Look for unexpected files in .claude folders and in locations outside your projects, such as shell startup files, with modification times inside agent sessions. Review session history for commands that pipe echo into sed and redirect to a path outside the working tree. Beam logs the shell commands and file access of agents and its rules flag risky ones, which includes writes to agent config folders.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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!

Questions

Is CVE-2026-25723 exploitable without accept edits?

The advisory says exploitation required the ability to execute commands through Claude Code with the "accept edits" feature enabled.

What can be written?

Files in sensitive directories like .claude and paths outside the project scope, which the write restrictions should have blocked.

Which version fixes it?

2.0.55. Check with claude --version; auto-update installs received it automatically.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Claude Code vulnerabilities

All Claude Code entries