Executive brief
Roo-Code is a development tool that uses AI-powered code search and automation features. A vulnerability allows attackers to embed malicious commands in code comments that are automatically executed when developers search the codebase, potentially leading to credential theft and unauthorized command execution on the developer's machine.
Technical details
The vulnerability is a code injection flaw (CWE-94) in Roo-Code's RAG (Retrieval-Augmented Generation) system, specifically in the CodeIndexManager component. The system indexes and retrieves code comments without sanitization or validation. Attackers can embed malicious shell commands disguised as internal security notes or audit requirements in code comments; when these comments are retrieved during normal codebase searches, the AI agent executes the embedded commands with the user's privileges. Attack preconditions include having a malicious comment merged into a repository indexed by Roo-Code. No patch is available as the vendor has archived the project and no longer supports it.
Affected products
- RooCodeInc Roo-Code up to 3.51.1
Timeline
- 2026-08-27: disclosed
- 2026-06-20: exploited: Exploit PoC published on GitHub