Anthropic Claude CLI/SDK Prompt Editor OS Command Injection (CVE-2026-35021)
CVE-2026-35021 Published on April 6, 2026
Anthropic Claude Code & Agent SDK OS Command Injection via promptEditor.ts
Anthropic Claude Code CLI and Claude Agent SDK contain an OS command injection vulnerability in the prompt editor invocation utility that allows attackers to execute arbitrary commands by crafting malicious file paths. Attackers can inject shell metacharacters such as $() or backtick expressions into file paths that are interpolated into shell commands executed via execSync. Although the file path is wrapped in double quotes, POSIX shell semantics (POSIX §2.2.3) do not prevent command substitution within double quotes, allowing injected expressions to be evaluated and resulting in arbitrary command execution with the privileges of the user running the CLI.
Vulnerability Analysis
CVE-2026-35021 can be exploited with local system access, requires user interaction. This vulnerability is considered to have a low attack complexity. Public availability of a proof of concept (POC) exploit exists for CVE-2026-35021. The potential impact of an exploit of this vulnerability is considered to be very high.
Weakness Type
What is a Shell injection Vulnerability?
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
CVE-2026-35021 has been classified to as a Shell injection vulnerability or weakness.
Products Associated with CVE-2026-35021
Want to know whenever a new CVE is published for Anthropic Claude Code? stack.watch will email you.
Affected Versions
Anthropic Claude Code:- Before and including 2.1.91 is affected.
- Before and including 0.1.55 is affected.
Exploit Probability
EPSS (Exploit Prediction Scoring System) scores estimate the probability that a vulnerability will be exploited in the wild within the next 30 days. The percentile shows you how this score compares to all other vulnerabilities.