CVE-2025-58374: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in RooCodeInc Roo-Code
Roo Code is an AI-powered autonomous coding agent that lives in users' editors. Versions 3.25.23 and below contain a default list of allowed commands that do not need manual approval if auto-approve is enabled, and npm install is included in that list. Because npm install executes lifecycle scripts, if a repository’s package.json file contains a malicious postinstall script, it would be executed automatically without user approval. This means that enabling auto-approved commands and opening a malicious repo could result in arbitrary code execution. This is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2025-58374 is a high-severity OS command injection vulnerability affecting RooCodeInc's Roo-Code product, versions prior to 3.26.0. Roo-Code is an AI-powered autonomous coding agent integrated into users' code editors to assist with development tasks. The vulnerability arises from the product's handling of auto-approved commands, specifically the inclusion of 'npm install' in the default allowed commands list when auto-approve is enabled. The 'npm install' command executes lifecycle scripts defined in a repository's package.json file, including potentially malicious postinstall scripts. Because these scripts run automatically without manual user approval under the auto-approve setting, an attacker can craft a malicious repository containing a harmful postinstall script. When a user opens this repository and Roo-Code executes 'npm install' automatically, the malicious script runs with the user's privileges, leading to arbitrary code execution on the host system. This vulnerability is classified under CWE-78 (Improper Neutralization of Special Elements used in an OS Command), indicating that the product fails to properly sanitize or restrict command inputs, allowing injection of harmful commands. The CVSS v3.1 base score is 7.8, reflecting high impact on confidentiality, integrity, and availability, with low attack complexity, no privileges required, but requiring user interaction (opening a malicious repo). No known exploits in the wild have been reported yet. The issue was addressed in Roo-Code version 3.26.0 by presumably removing 'npm install' from auto-approved commands or adding stricter validation and user approval requirements. This vulnerability highlights the risks of automated command execution in developer tools, especially when combined with package managers that run lifecycle scripts, which can be abused for code execution if not properly controlled.
Potential Impact
For European organizations, this vulnerability poses a significant risk, particularly for software development teams using Roo-Code in their development environments. Successful exploitation could lead to arbitrary code execution on developer machines, potentially allowing attackers to steal sensitive source code, credentials, or intellectual property. It could also serve as a foothold for lateral movement within corporate networks if the compromised developer environment has network access to internal resources. The impact extends to supply chain security, as malicious repositories could be used as attack vectors. Given the widespread use of Node.js and npm in European software development, and the increasing adoption of AI-powered coding assistants, the risk is amplified. Organizations involved in critical infrastructure, finance, telecommunications, and technology sectors are especially vulnerable due to the sensitivity of their codebases and the potential for disruption. Additionally, the vulnerability could be exploited to implant persistent malware or backdoors, undermining trust in development pipelines and potentially violating GDPR requirements related to data protection and breach notification.
Mitigation Recommendations
European organizations should take immediate steps to mitigate this vulnerability. First, upgrade Roo-Code to version 3.26.0 or later, where the issue is fixed. If upgrading is not immediately possible, disable the auto-approve feature for commands, especially those involving 'npm install' or other package manager commands that execute lifecycle scripts. Implement strict policies to restrict the use of untrusted or unknown repositories, including scanning package.json files for suspicious lifecycle scripts before opening repositories. Employ endpoint protection solutions capable of detecting anomalous script execution triggered by npm lifecycle events. Educate developers about the risks of opening untrusted repositories and encourage manual review of package scripts. Integrate code signing or repository whitelisting mechanisms to ensure only trusted code is executed. Monitor developer workstations for unusual process activity related to npm or shell commands. Finally, incorporate this vulnerability into supply chain risk assessments and incident response plans to quickly identify and respond to potential exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland
CVE-2025-58374: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in RooCodeInc Roo-Code
Description
Roo Code is an AI-powered autonomous coding agent that lives in users' editors. Versions 3.25.23 and below contain a default list of allowed commands that do not need manual approval if auto-approve is enabled, and npm install is included in that list. Because npm install executes lifecycle scripts, if a repository’s package.json file contains a malicious postinstall script, it would be executed automatically without user approval. This means that enabling auto-approved commands and opening a malicious repo could result in arbitrary code execution. This is fixed in version 3.26.0.
AI-Powered Analysis
Technical Analysis
CVE-2025-58374 is a high-severity OS command injection vulnerability affecting RooCodeInc's Roo-Code product, versions prior to 3.26.0. Roo-Code is an AI-powered autonomous coding agent integrated into users' code editors to assist with development tasks. The vulnerability arises from the product's handling of auto-approved commands, specifically the inclusion of 'npm install' in the default allowed commands list when auto-approve is enabled. The 'npm install' command executes lifecycle scripts defined in a repository's package.json file, including potentially malicious postinstall scripts. Because these scripts run automatically without manual user approval under the auto-approve setting, an attacker can craft a malicious repository containing a harmful postinstall script. When a user opens this repository and Roo-Code executes 'npm install' automatically, the malicious script runs with the user's privileges, leading to arbitrary code execution on the host system. This vulnerability is classified under CWE-78 (Improper Neutralization of Special Elements used in an OS Command), indicating that the product fails to properly sanitize or restrict command inputs, allowing injection of harmful commands. The CVSS v3.1 base score is 7.8, reflecting high impact on confidentiality, integrity, and availability, with low attack complexity, no privileges required, but requiring user interaction (opening a malicious repo). No known exploits in the wild have been reported yet. The issue was addressed in Roo-Code version 3.26.0 by presumably removing 'npm install' from auto-approved commands or adding stricter validation and user approval requirements. This vulnerability highlights the risks of automated command execution in developer tools, especially when combined with package managers that run lifecycle scripts, which can be abused for code execution if not properly controlled.
Potential Impact
For European organizations, this vulnerability poses a significant risk, particularly for software development teams using Roo-Code in their development environments. Successful exploitation could lead to arbitrary code execution on developer machines, potentially allowing attackers to steal sensitive source code, credentials, or intellectual property. It could also serve as a foothold for lateral movement within corporate networks if the compromised developer environment has network access to internal resources. The impact extends to supply chain security, as malicious repositories could be used as attack vectors. Given the widespread use of Node.js and npm in European software development, and the increasing adoption of AI-powered coding assistants, the risk is amplified. Organizations involved in critical infrastructure, finance, telecommunications, and technology sectors are especially vulnerable due to the sensitivity of their codebases and the potential for disruption. Additionally, the vulnerability could be exploited to implant persistent malware or backdoors, undermining trust in development pipelines and potentially violating GDPR requirements related to data protection and breach notification.
Mitigation Recommendations
European organizations should take immediate steps to mitigate this vulnerability. First, upgrade Roo-Code to version 3.26.0 or later, where the issue is fixed. If upgrading is not immediately possible, disable the auto-approve feature for commands, especially those involving 'npm install' or other package manager commands that execute lifecycle scripts. Implement strict policies to restrict the use of untrusted or unknown repositories, including scanning package.json files for suspicious lifecycle scripts before opening repositories. Employ endpoint protection solutions capable of detecting anomalous script execution triggered by npm lifecycle events. Educate developers about the risks of opening untrusted repositories and encourage manual review of package scripts. Integrate code signing or repository whitelisting mechanisms to ensure only trusted code is executed. Monitor developer workstations for unusual process activity related to npm or shell commands. Finally, incorporate this vulnerability into supply chain risk assessments and incident response plans to quickly identify and respond to potential exploitation attempts.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2025-08-29T16:19:59.012Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 68bb9c18535f4a97731dab54
Added to database: 9/6/2025, 2:27:36 AM
Last enriched: 9/13/2025, 3:42:48 AM
Last updated: 10/21/2025, 10:18:50 PM
Views: 44
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-62641: Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change). Successful attacks of this vulnerability can result in takeover of Oracle VM VirtualBox. in Oracle Corporation Oracle VM VirtualBox
HighCVE-2025-62592: Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change). Successful attacks of this vulnerability can result in unauthorized access to critical data or complete access to all Oracle VM VirtualBox accessible data. in Oracle Corporation Oracle VM VirtualBox
MediumCVE-2025-62591: Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change). Successful attacks of this vulnerability can result in unauthorized access to critical data or complete access to all Oracle VM VirtualBox accessible data. in Oracle Corporation Oracle VM VirtualBox
MediumCVE-2025-62590: Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change). Successful attacks of this vulnerability can result in takeover of Oracle VM VirtualBox. in Oracle Corporation Oracle VM VirtualBox
HighCVE-2025-62589: Easily exploitable vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromise Oracle VM VirtualBox. While the vulnerability is in Oracle VM VirtualBox, attacks may significantly impact additional products (scope change). Successful attacks of this vulnerability can result in takeover of Oracle VM VirtualBox. in Oracle Corporation Oracle VM VirtualBox
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.