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-2025-58372

CVE-2025-58372: Roocode Roo Code RCE Vulnerability

CVE-2025-58372 is a remote code execution vulnerability in Roocode Roo Code affecting versions 3.25.23 and below. Attackers can exploit workspace configuration files to execute arbitrary code. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: March 18, 2026

CVE-2025-58372 Overview

CVE-2025-58372 is a critical Code Injection vulnerability affecting Roo Code, an AI-powered autonomous coding agent that operates within users' VS Code editors. The vulnerability exists because certain VS Code workspace configuration files (.code-workspace) are not protected in the same way as the .vscode folder. When the agent is configured to auto-approve file writes, an attacker capable of influencing prompts through prompt injection could cause malicious workspace settings or tasks to be written. These malicious tasks could then be executed automatically when the workspace is reopened, resulting in arbitrary code execution on the victim's system.

Critical Impact

This vulnerability allows attackers to achieve arbitrary code execution through prompt injection attacks against the AI coding agent, potentially compromising developer workstations and source code repositories.

Affected Products

  • Roo Code versions 3.25.23 and below
  • VS Code extensions utilizing Roo Code with auto-approve file write configurations
  • Developer environments with unprotected .code-workspace files

Discovery Timeline

  • September 5, 2025 - CVE CVE-2025-58372 published to NVD
  • September 15, 2025 - Last updated in NVD database

Technical Details for CVE-2025-58372

Vulnerability Analysis

This vulnerability represents a significant security gap in how Roo Code handles workspace configuration files. While the .vscode folder receives protection to prevent unauthorized modifications, .code-workspace files were not included in this protected file list. This oversight creates an attack surface where prompt injection techniques can be leveraged to modify workspace configurations.

The attack chain involves an adversary influencing the AI agent's prompts to write malicious content to .code-workspace files. Since these files can contain task definitions and workspace settings that VS Code automatically processes, any malicious tasks embedded in these files execute when the workspace is subsequently opened. This transforms what appears to be a configuration file modification into a full arbitrary code execution vulnerability.

Root Cause

The root cause is an incomplete implementation of file protection mechanisms within Roo Code's RooProtectedController.ts component. The protected file patterns included .vscode/** directories and various configuration files but failed to include *.code-workspace files in the protection list. This CWE-94 (Improper Control of Generation of Code) vulnerability allowed the AI agent to write to these sensitive workspace files when auto-approve was enabled.

Attack Vector

The attack vector is network-based and requires no user interaction or privileges. An attacker must first establish the ability to influence the AI agent's prompts—for example, through malicious content in repositories, documentation, or other sources the agent processes. Once prompt injection is achieved, the attacker can instruct the agent to write malicious task configurations to .code-workspace files. The payload executes automatically when the developer reopens their workspace, requiring no additional interaction.

typescript
// Security patch from RooProtectedController.ts
// Source: https://github.com/RooCodeInc/Roo-Code/commit/296edfc829a7c6efc8b5dbe09aa766a9aed79598

 		".clinerules*",
 		".roo/**",
 		".vscode/**",
+		"*.code-workspace",
 		".rooprotected", // For future use
 		"AGENTS.md",
-		"AGENT.md", // Alternative singular form for compatibility
+		"AGENT.md",
 	]

 	constructor(cwd: string) {

The patch adds *.code-workspace to the list of protected file patterns, preventing the AI agent from writing to these files regardless of auto-approve settings.

Detection Methods for CVE-2025-58372

Indicators of Compromise

  • Unexpected modifications to .code-workspace files in project repositories
  • Presence of malicious task definitions within workspace configuration files
  • Unusual VS Code task executions upon workspace opening
  • Evidence of prompt injection attempts in AI agent logs or conversation history

Detection Strategies

  • Monitor file system changes to .code-workspace files for unauthorized modifications
  • Implement code review processes for workspace configuration file changes
  • Audit AI agent activity logs for suspicious prompt patterns or file write operations
  • Deploy endpoint detection rules to identify unexpected process spawning from VS Code task execution

Monitoring Recommendations

  • Enable file integrity monitoring for workspace configuration files across development environments
  • Configure SentinelOne to alert on suspicious VS Code child process activity
  • Review and audit auto-approve settings in Roo Code configurations
  • Implement repository scanning for malicious workspace configuration files in CI/CD pipelines

How to Mitigate CVE-2025-58372

Immediate Actions Required

  • Upgrade Roo Code to version 3.26.0 or later immediately
  • Disable auto-approve file write settings in Roo Code until the patch is applied
  • Audit existing .code-workspace files for any suspicious or unexpected task definitions
  • Review recent AI agent activity for potential prompt injection attempts

Patch Information

The vulnerability is fixed in Roo Code version 3.26.0. The patch adds *.code-workspace files to the protected file patterns in RooProtectedController.ts, preventing the AI agent from writing to these sensitive configuration files. Administrators should update all Roo Code installations via the VS Code extension marketplace. For detailed patch information, refer to the GitHub Security Advisory GHSA-4pqh-4ggm-jfmm and the GitHub Release v3.26.0.

Workarounds

  • Disable auto-approve file write functionality in Roo Code settings until the update can be applied
  • Manually add .code-workspace files to a custom .rooprotected configuration if supported
  • Remove or rename existing .code-workspace files temporarily and recreate after patching
  • Implement strict workspace trust settings in VS Code to prevent automatic task execution
bash
# Configuration example - Check current Roo Code version
code --list-extensions --show-versions | grep -i roo

# Update Roo Code extension via command line
code --install-extension roocode.roo-code --force

# Verify workspace files for suspicious tasks (Linux/macOS)
find . -name "*.code-workspace" -exec grep -l "tasks" {} \;

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechRoocode

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GitHub Release v3.26.0
  • Vendor Resources
  • GitHub Commit Details

  • GitHub Security Advisory GHSA-4pqh-4ggm-jfmm
  • Related CVEs
  • CVE-2025-58371: Roocode Roo Code RCE 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