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-22708

CVE-2026-22708: Cursor AI Code Editor RCE Vulnerability

CVE-2026-22708 is a remote code execution flaw in Cursor AI code editor that allows shell built-ins to bypass allowlist protections in Auto-Run Mode. This post explains its impact, affected versions, and mitigation steps.

Published: January 23, 2026

CVE-2026-22708 Overview

CVE-2026-22708 is a vulnerability in Cursor, a code editor built for programming with AI. Prior to version 2.3, when the Cursor Agent is running in Auto-Run Mode with Allowlist mode enabled, certain shell built-ins can still be executed without appearing in the allowlist and without requiring user approval. This allows an attacker via indirect or direct prompt injection to poison the shell environment by setting, modifying, or removing environment variables that influence trusted commands.

Critical Impact

Attackers can exploit prompt injection to manipulate shell environment variables, potentially hijacking trusted command execution and bypassing security controls in Cursor's Auto-Run Mode.

Affected Products

  • Cursor AI Code Editor versions prior to 2.3

Discovery Timeline

  • 2026-01-14 - CVE CVE-2026-22708 published to NVD
  • 2026-01-16 - Last updated in NVD database

Technical Details for CVE-2026-22708

Vulnerability Analysis

This vulnerability is classified under CWE-15 (External Control of System or Configuration Setting), which occurs when an application allows external control over system-level settings that can influence system behavior. In the context of Cursor's AI-powered code editor, the Cursor Agent's Auto-Run Mode is designed to automatically execute certain approved commands based on an allowlist configuration.

The fundamental issue lies in how shell built-in commands are handled by the security mechanism. While external commands are properly validated against the allowlist before execution, shell built-ins—such as export, unset, set, and others—bypass this validation entirely. These built-ins operate within the shell session itself rather than as separate executable binaries, creating a gap in the security model.

An attacker leveraging prompt injection (either direct manipulation or indirect injection through malicious content in processed files) can instruct the AI agent to execute shell built-ins that modify environment variables. These modified variables can then influence the behavior of subsequently executed trusted commands, effectively achieving command hijacking without triggering the approval workflow.

Root Cause

The root cause is the incomplete enforcement of the allowlist security model when the Cursor Agent is in Auto-Run Mode. Shell built-in commands are not subject to the same allowlist verification as external commands, allowing them to execute without user approval. This creates an authorization bypass where the security boundary fails to account for all executable command types within the shell environment.

Attack Vector

The attack vector is network-based through prompt injection. An attacker can craft malicious prompts—either directly through user input or indirectly through poisoned content in files, repositories, or web content processed by the AI—to manipulate the Cursor Agent into executing shell built-in commands. These commands modify environment variables such as PATH, LD_PRELOAD, LD_LIBRARY_PATH, or application-specific variables to influence how trusted allowlisted commands behave when subsequently executed.

For example, an attacker could poison the PATH variable to prioritize a malicious directory, causing a trusted command like git or npm to resolve to an attacker-controlled binary instead of the legitimate system binary. Since the environment modification occurs via shell built-ins that bypass the allowlist, the attack proceeds without triggering user approval.

For detailed technical information about this vulnerability, refer to the GitHub Security Advisory.

Detection Methods for CVE-2026-22708

Indicators of Compromise

  • Unexpected modifications to shell environment variables (PATH, LD_PRELOAD, LD_LIBRARY_PATH, HOME, etc.) during Cursor Agent sessions
  • Execution of shell built-in commands (export, unset, set, alias) that were not explicitly requested by the user
  • Anomalous command resolution where trusted commands execute from unexpected locations
  • Evidence of prompt injection patterns in AI agent interaction logs or processed content

Detection Strategies

  • Monitor Cursor Agent logs for shell built-in command execution patterns, particularly environment variable modifications
  • Implement runtime monitoring of environment variable changes within Cursor sessions
  • Deploy endpoint detection rules to identify suspicious export or unset commands executed in rapid succession
  • Analyze AI agent prompts and responses for injection patterns attempting to manipulate command execution

Monitoring Recommendations

  • Enable verbose logging for Cursor Agent Auto-Run Mode sessions to capture all executed commands including shell built-ins
  • Implement baseline monitoring of environment variable states before and after Cursor Agent operations
  • Configure alerts for any shell environment modifications during automated agent execution
  • Review processed files and repository content for potential prompt injection payloads

How to Mitigate CVE-2026-22708

Immediate Actions Required

  • Upgrade Cursor to version 2.3 or later immediately to remediate this vulnerability
  • Disable Auto-Run Mode until the upgrade can be completed if immediate patching is not possible
  • Review Cursor Agent activity logs for any signs of environment manipulation or prompt injection attempts
  • Consider running Cursor in isolated environments with restricted shell capabilities until the patch is applied

Patch Information

This vulnerability is fixed in Cursor version 2.3. Users should upgrade to this version or later to ensure protection against shell environment poisoning attacks via prompt injection. For additional details and the official security advisory, see the GitHub Security Advisory for GHSA-82wg-qcm4-fp2w.

Workarounds

  • Disable Auto-Run Mode entirely and require manual approval for all agent-executed commands
  • If Auto-Run Mode must be used, avoid processing untrusted files, repositories, or content that could contain prompt injection payloads
  • Implement network segmentation to limit the impact of potential environment manipulation
  • Use containerized or sandboxed execution environments for Cursor to limit the blast radius of any successful exploitation
bash
# Configuration example: Disable Auto-Run Mode in Cursor settings
# Navigate to Settings > AI Agent > Auto-Run Mode
# Set "Auto-Run Mode" to "Disabled" or "Manual Approval Required"
# This ensures all agent commands require explicit user approval

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechCursor

  • SeverityHIGH

  • CVSS Score7.2

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U/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
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-15
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-31854: Cursor Code Editor RCE Vulnerability
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