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

CVE-2025-64755: @anthropic-ai/claude-code has Sed Command Validation Bypass that Allows Arbitrary File Writes

highCVSS 4.0 8.7GHSA-7mv8-j34q-vp7q

Claude Code before 2.0.31 mis-parses `sed` commands in its read-only validation. A `sed` invocation that should only read can write to arbitrary files on the host, with no approval prompt. Auto-updating installs already have the fix. Manual installs should move to 2.0.31 or later.

Published Nov 20, 2025 · Updated Nov 21, 2025 · Analysis Nov 1, 2026

What an attacker can do

Claude Code lets the model run some shell commands without asking, if its validator decides they are read-only. sed is on that list because it usually just prints transformed text. The advisory says an error in how sed commands are parsed let one pass that check and still write to files. Where sed can write (the w command, or the -i in-place flag), the attacker gets a file write at the user's privileges.

A write to a chosen path is strong. The agent's own settings, shell startup files like ~/.bashrc, git hooks, SSH authorized_keys and project scripts are all targets. Once one of those is changed, code runs later without any prompt, so a file write usually turns into code execution.

The CVSS 4.0 vector shows no privileges needed, a network vector and passive user interaction. In practice the model must be talked into issuing the command, for example by prompt injection in a repository file, web page or tool output that it reads. The advisory does not describe the exact sed syntax that bypassed the check.

Who is affected

@anthropic-ai/claude-code below 2.0.31. Standard auto-update users received the fix automatically. Check manually managed installs, pinned versions in Dockerfiles and CI images.

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

@anthropic-ai/claude-code

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

How to fix it

Upgrade to 2.0.31 or later:

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

The advisory lists no workarounds. Until you have upgraded, treat any content the agent reads from outside your trust boundary as hostile, and review recent changes to files the agent could reach, such as shell profiles and git hooks.

How to tell if you were hit

Check the version on each workstation and CI image first. Then look through session transcripts and shell history for sed calls with a write command or an in-place flag that the agent ran without asking, particularly those aimed at paths outside the project. Compare modification times of ~/.bashrc, ~/.zshrc, ~/.ssh/authorized_keys, .git/hooks/ and the Claude settings files with your own activity. Unexpected changes there are the signal.

Beam records the shell commands and file access of coding agents like Claude Code, and its rules flag risky ones, so a sed run that writes outside the project shows in its record.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Due to an error in sed command parsing, it was possible to bypass the Claude Code read-only validation and write to arbitrary files on the host system.

Users on standard Claude Code auto-update will have received this fix automatically. Users performing manual updates are advised to update to the latest version.

Thank you to Adam Chester - SpecterOps for reporting this issue!

Questions

Which Claude Code version fixes CVE-2025-64755?

2.0.31. Versions below it are affected. Standard auto-update users already received the fix.

Can sed really write files if the command looks read-only?

Per the advisory, an error in sed parsing let a command pass Claude Code's read-only validation and write to arbitrary files on the host. The advisory does not publish the exact syntax.

Who reported this issue?

Adam Chester of SpecterOps, according to the advisory.

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