The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-35020

CVE-2026-35020: Claude CLI OS Command Injection Vulnerability

CVE-2026-35020 is an OS command injection flaw in Anthropic Claude Code CLI and Agent SDK that allows local attackers to execute arbitrary commands via TERMINAL variable manipulation. This article covers technical details, impact, and mitigation.

Published: April 10, 2026

CVE-2026-35020 Overview

Anthropic Claude Code CLI and Claude Agent SDK contain an OS command injection vulnerability (CWE-78) 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.

Critical Impact

Local attackers can achieve arbitrary command execution with full user privileges by injecting malicious shell metacharacters into the TERMINAL environment variable, potentially leading to credential exfiltration and complete system compromise.

Affected Products

  • Anthropic Claude Code CLI
  • Anthropic Claude Agent SDK
  • Systems using the command lookup helper with shell=true execution

Discovery Timeline

  • 2026-04-06 - CVE-2026-35020 published to NVD
  • 2026-04-07 - Last updated in NVD database

Technical Details for CVE-2026-35020

Vulnerability Analysis

This vulnerability stems from unsafe handling of environment variables when constructing shell commands. The Claude Code CLI and Agent SDK utilize a command lookup helper that reads the TERMINAL environment variable to determine which terminal emulator to use for launching processes. When this value is passed to a shell execution function with shell=true, the variable content is not properly sanitized, allowing shell metacharacters to be interpreted and executed.

The deep-link terminal launcher provides an additional attack surface, as it also relies on the same unsafe command construction pattern. This creates multiple entry points for exploitation, making the vulnerability particularly concerning for CI/CD environments where environment variables may be influenced by external inputs.

Root Cause

The root cause is improper input validation (CWE-78: OS Command Injection) in the command lookup helper component. The TERMINAL environment variable is directly concatenated into shell commands without sanitization or escaping of special characters. When these commands are executed with shell=true, the shell interprets metacharacters such as semicolons, backticks, $(), and pipe operators, allowing command chaining and injection.

Attack Vector

This is a local attack vector requiring the attacker to have the ability to control or influence the TERMINAL environment variable before the CLI is executed. Attack scenarios include:

  1. CI/CD Pipeline Exploitation - Attackers with access to CI/CD configuration can set malicious environment variables that persist when Claude Code CLI is invoked during build or deployment processes

  2. Shared System Exploitation - On multi-user systems, an attacker could potentially influence environment variables through various means such as shell initialization scripts or profile configurations

  3. Deep-Link Handler Abuse - The deep-link terminal launcher path provides an alternative trigger mechanism where specially crafted deep-links could invoke the vulnerable code path

The attacker sets the TERMINAL environment variable to include shell metacharacters and malicious commands. When the CLI executes and reaches the command lookup helper, the malicious payload is passed to /bin/sh and executed with the privileges of the user running the CLI. This can result in credential theft, data exfiltration, or further system compromise.

Detection Methods for CVE-2026-35020

Indicators of Compromise

  • Unusual or malformed values in the TERMINAL environment variable containing shell metacharacters (;, |, $(), backticks)
  • Unexpected child processes spawned by Claude Code CLI or Claude Agent SDK
  • Anomalous network connections or file access patterns originating from CLI processes
  • Evidence of credential access or exfiltration attempts coinciding with CLI execution times

Detection Strategies

  • Monitor environment variable values for shell metacharacters before CLI invocation, particularly in CI/CD pipelines
  • Implement process monitoring to detect unexpected command execution patterns from Claude Code CLI processes
  • Deploy file integrity monitoring on sensitive credential stores and configuration files
  • Enable comprehensive logging of shell command executions and environment variable states

Monitoring Recommendations

  • Configure SIEM alerts for process trees showing suspicious child processes spawned by Claude CLI components
  • Monitor for environment variable manipulation in CI/CD job logs and audit trails
  • Track network egress from systems running Claude Code CLI for potential data exfiltration
  • Implement baseline behavior analysis to detect anomalous CLI execution patterns

How to Mitigate CVE-2026-35020

Immediate Actions Required

  • Audit all environments where Claude Code CLI or Claude Agent SDK are deployed for potentially malicious TERMINAL variable values
  • Restrict environment variable setting capabilities in CI/CD pipelines to trusted sources only
  • Implement environment variable allowlisting or sanitization before invoking CLI tools
  • Review access controls on systems where the vulnerable components are installed

Patch Information

Review the VulnCheck Advisory and Phoenix Security Analysis for the latest patch information and updated versions. Apply vendor-provided security updates as soon as they become available to address this command injection vulnerability.

Workarounds

  • Set the TERMINAL environment variable to a known-safe, hardcoded value before invoking the CLI
  • Use wrapper scripts that sanitize or unset the TERMINAL variable prior to CLI execution
  • Run Claude Code CLI in isolated environments with restricted environment variable inheritance
  • Implement network segmentation to limit potential exfiltration if exploitation occurs

The following example demonstrates how to sanitize the environment before invoking the CLI:

bash
# Configuration example - Sanitize TERMINAL variable before CLI execution
# Unset potentially malicious TERMINAL variable
unset TERMINAL

# Or set to a known-safe value
export TERMINAL="xterm"

# Verify no shell metacharacters are present
if [[ "$TERMINAL" =~ [\;\|\`\$\(\)] ]]; then
    echo "ERROR: Invalid TERMINAL value detected"
    exit 1
fi

# Execute CLI with sanitized environment
claude-code "$@"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechAnthropic Claude

  • SeverityHIGH

  • CVSS Score8.6

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-78
  • Technical References
  • Phoenix Security Analysis

  • VulnCheck Advisory
  • Related CVEs
  • CVE-2026-35022: Claude CLI & SDK RCE Vulnerability

  • CVE-2026-22561: Claude for Windows Privilege Escalation Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English