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 Roo-Code, an AI-powered autonomous coding agent integrated within users' code editors. The vulnerability exists in versions prior to 3.26.0, where the application maintains a default list of commands that can be auto-approved without manual user consent if the auto-approve feature is enabled. Among these commands is 'npm install', which is particularly risky because it executes lifecycle scripts defined in a repository's package.json file, including potentially malicious postinstall scripts. An attacker who crafts a malicious repository with a harmful postinstall script can exploit this vulnerability by tricking a user into opening the repository with Roo-Code configured to auto-approve commands. This results in arbitrary code execution on the user's machine without explicit approval, compromising confidentiality, integrity, and availability. The vulnerability is classified under CWE-78 (Improper Neutralization of Special Elements used in an OS Command), indicating that special characters or commands are not properly sanitized before execution. The CVSS v3.1 base score is 7.8, reflecting high severity due to local attack vector, low attack complexity, no privileges required, but requiring user interaction (opening a malicious repo). The vulnerability affects the integrity and confidentiality of the system by allowing arbitrary code execution and potentially full system compromise. The issue was addressed and fixed in Roo-Code version 3.26.0.
Potential Impact
For European organizations, this vulnerability poses a significant risk especially to development teams and environments where Roo-Code is used to automate coding tasks. Since the attack requires opening a malicious repository, the threat vector is primarily through supply chain attacks or social engineering targeting developers. Successful exploitation could lead to unauthorized code execution, data theft, insertion of backdoors, or disruption of development workflows. This could compromise sensitive intellectual property, customer data, and internal systems. Given the widespread use of Node.js and npm in European software development, and the increasing adoption of AI coding assistants, the vulnerability could affect a broad range of organizations, from startups to large enterprises. The risk is heightened in environments where auto-approve is enabled for convenience, potentially bypassing security controls. Additionally, the vulnerability could be leveraged to pivot into corporate networks, escalating the impact beyond individual developer machines. The lack of known exploits in the wild currently reduces immediate risk but does not diminish the potential impact if weaponized.
Mitigation Recommendations
European organizations should immediately upgrade Roo-Code to version 3.26.0 or later to remediate this vulnerability. Until the upgrade is applied, it is critical to disable the auto-approve feature for commands, especially those involving 'npm install' or other commands that execute lifecycle scripts. Developers should be trained to avoid opening untrusted repositories and to scrutinize package.json scripts for suspicious postinstall or lifecycle commands. Implementing endpoint protection with behavioral detection can help identify anomalous script executions. Organizations should also enforce strict code repository policies, including scanning dependencies and scripts for malicious content before use. Integrating static and dynamic analysis tools in CI/CD pipelines can detect potential malicious scripts early. Network segmentation and least privilege principles should be applied to limit the impact of any compromise. Finally, monitoring logs for unexpected npm lifecycle script executions can provide early indicators of exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Ireland, Belgium
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 Roo-Code, an AI-powered autonomous coding agent integrated within users' code editors. The vulnerability exists in versions prior to 3.26.0, where the application maintains a default list of commands that can be auto-approved without manual user consent if the auto-approve feature is enabled. Among these commands is 'npm install', which is particularly risky because it executes lifecycle scripts defined in a repository's package.json file, including potentially malicious postinstall scripts. An attacker who crafts a malicious repository with a harmful postinstall script can exploit this vulnerability by tricking a user into opening the repository with Roo-Code configured to auto-approve commands. This results in arbitrary code execution on the user's machine without explicit approval, compromising confidentiality, integrity, and availability. The vulnerability is classified under CWE-78 (Improper Neutralization of Special Elements used in an OS Command), indicating that special characters or commands are not properly sanitized before execution. The CVSS v3.1 base score is 7.8, reflecting high severity due to local attack vector, low attack complexity, no privileges required, but requiring user interaction (opening a malicious repo). The vulnerability affects the integrity and confidentiality of the system by allowing arbitrary code execution and potentially full system compromise. The issue was addressed and fixed in Roo-Code version 3.26.0.
Potential Impact
For European organizations, this vulnerability poses a significant risk especially to development teams and environments where Roo-Code is used to automate coding tasks. Since the attack requires opening a malicious repository, the threat vector is primarily through supply chain attacks or social engineering targeting developers. Successful exploitation could lead to unauthorized code execution, data theft, insertion of backdoors, or disruption of development workflows. This could compromise sensitive intellectual property, customer data, and internal systems. Given the widespread use of Node.js and npm in European software development, and the increasing adoption of AI coding assistants, the vulnerability could affect a broad range of organizations, from startups to large enterprises. The risk is heightened in environments where auto-approve is enabled for convenience, potentially bypassing security controls. Additionally, the vulnerability could be leveraged to pivot into corporate networks, escalating the impact beyond individual developer machines. The lack of known exploits in the wild currently reduces immediate risk but does not diminish the potential impact if weaponized.
Mitigation Recommendations
European organizations should immediately upgrade Roo-Code to version 3.26.0 or later to remediate this vulnerability. Until the upgrade is applied, it is critical to disable the auto-approve feature for commands, especially those involving 'npm install' or other commands that execute lifecycle scripts. Developers should be trained to avoid opening untrusted repositories and to scrutinize package.json scripts for suspicious postinstall or lifecycle commands. Implementing endpoint protection with behavioral detection can help identify anomalous script executions. Organizations should also enforce strict code repository policies, including scanning dependencies and scripts for malicious content before use. Integrating static and dynamic analysis tools in CI/CD pipelines can detect potential malicious scripts early. Network segmentation and least privilege principles should be applied to limit the impact of any compromise. Finally, monitoring logs for unexpected npm lifecycle script executions can provide early indicators of 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/6/2025, 2:42:47 AM
Last updated: 9/8/2025, 6:22:44 AM
Views: 16
Related Threats
CVE-2025-5993: CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in ITCube Software ITCube CRM
CriticalCVE-2025-10090: SQL Injection in Jinher OA
MediumCVE-2025-58782: CWE-502 Deserialization of Untrusted Data in Apache Software Foundation Apache Jackrabbit Core
CriticalCVE-2025-10088: Cross Site Scripting in SourceCodester Time Tracker
MediumCVE-2025-41708: CWE-319 Cleartext Transmission of Sensitive Information in Bender CC612
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.