Executive brief
agent-coderag is an AI-assisted code analysis tool used to index software repositories. A security flaw allows a malicious repository to execute arbitrary commands on a user's computer when they attempt to index it. This could lead to full system compromise, including the theft of sensitive data or installation of malware, simply by running the tool on an untrusted project.
Technical details
An arbitrary code execution vulnerability exists in agent-coderag due to insecure handling of the Gradle Wrapper during dependency discovery. When the 'sync' command is invoked, the tool detects Gradle projects by the presence of 'build.gradle' and automatically attempts to execute a local 'gradlew' or 'gradlew.bat' file found in the repository root. Because the tool performs no content validation or integrity checks on this script before execution via asyncio.create_subprocess_exec, an attacker can provide a malicious script that executes with the privileges of the user running the tool. This is fixed in version 1.3.1.
Affected products
- naranor agent-coderag <= 1.3.0
Timeline
- 2026-06-18: disclosed
- 2026-06-19: advisory