CVE-2025-58374
📋 TL;DR
CVE-2025-58374 is a command injection vulnerability in Roo Code's auto-approve feature that allows arbitrary code execution when users open malicious repositories. The vulnerability affects users of Roo Code versions 3.25.23 and below who have auto-approve enabled. Attackers can exploit this by tricking users into opening repositories with malicious npm postinstall scripts.
💻 Affected Systems
- Roo Code
📦 What is this software?
Roo Code by Roocode
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise through arbitrary code execution with the privileges of the Roo Code user, potentially leading to data theft, ransomware deployment, or lateral movement within networks.
Likely Case
Malicious code execution in the context of the current user, enabling file system access, credential theft, and installation of persistent backdoors.
If Mitigated
No impact if auto-approve is disabled or if users only open trusted repositories from verified sources.
🎯 Exploit Status
Exploitation requires user to open a malicious repository, making it a targeted attack rather than automated exploitation.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.26.0
Vendor Advisory: https://github.com/RooCodeInc/Roo-Code/security/advisories/GHSA-c292-qxq4-4p2v
Restart Required: Yes
Instructions:
1. Update Roo Code to version 3.26.0 or higher. 2. Restart the Roo Code application. 3. Verify the update by checking the version in settings.
🔧 Temporary Workarounds
Disable auto-approve feature
allTurn off the auto-approve functionality to require manual approval for all commands including npm install.
Check Roo Code settings and disable 'Auto-approve commands' option
Restrict npm install from auto-approve list
allRemove npm install from the list of auto-approved commands if the feature cannot be completely disabled.
Edit Roo Code configuration to remove 'npm install' from auto-approved commands list
🧯 If You Can't Patch
- Disable auto-approve feature immediately in Roo Code settings
- Only open repositories from trusted sources and verify package.json files before opening
🔍 How to Verify
Check if Vulnerable:
Check Roo Code version in application settings. If version is 3.25.23 or below and auto-approve is enabled, the system is vulnerable.
Check Version:
Check version in Roo Code settings or run 'roo --version' if available via CLI
Verify Fix Applied:
Verify Roo Code version is 3.26.0 or higher in application settings.
📡 Detection & Monitoring
Log Indicators:
- Unexpected npm install executions
- Postinstall script executions from unknown repositories
- Commands executed without user approval in logs
Network Indicators:
- Unexpected network connections during npm install
- Downloads from suspicious package repositories
SIEM Query:
Process execution: 'npm install' AND Source: 'Roo Code' AND Context: 'auto-approved'