Описание
CAI find_file Agent Tool has Command Injection Vulnerability Through Argument Injection
Summary
The CAI (Cybersecurity AI) framework contains multiple argument injection vulnerabilities in its function tools. User-controlled input is passed directly to shell commands via subprocess.Popen() with shell=True, allowing attackers to execute arbitrary commands on the host system.
Vulnerable Component
Function: find_file() in src/cai/tools/reconnaissance/filesystem.py code
Attack Vector
An attacker can exploit this vulnerability through prompt injection:
- Attacker hosts a webpage containing malicious instructions in HTML comments
- Victim's CAI agent fetches and processes the webpage
- Agent is tricked into calling
find_file()with attacker-controlled arguments - The
-execflag enables arbitrary command execution
Proof of Concept
Malicious payload in HTML comments:
Resulting command execution:
Impact
The find_file() tool executes without requiring user approval because find is considered a "safe" pre-approved command. This means an attacker can achieve Remote Code Execution (RCE) by injecting malicious arguments (like -exec) into the args parameter, completely bypassing any human-in-the-loop safety mechanisms.
A patch is available: e22a122, but was not published to the PyPI at the time of advisory publication.
Ссылки
- https://github.com/aliasrobotics/cai/security/advisories/GHSA-jfpc-wj3m-qw2m
- https://nvd.nist.gov/vuln/detail/CVE-2026-25130
- https://github.com/aliasrobotics/cai/commit/e22a1220f764e2d7cf9da6d6144926f53ca01cde
- https://github.com/aliasrobotics/cai/blob/559de8fcbc2b44f3b0360f35ffdc2bb975e7d7e4/src/cai/tools/reconnaissance/filesystem.py#L60
Пакеты
cai-framework
<= 0.5.10
Отсутствует
Связанные уязвимости
Cybersecurity AI (CAI) is a framework for AI Security. In versions up to and including 0.5.10, the CAI (Cybersecurity AI) framework contains multiple argument injection vulnerabilities in its function tools. User-controlled input is passed directly to shell commands via `subprocess.Popen()` with `shell=True`, allowing attackers to execute arbitrary commands on the host system. The `find_file()` tool executes without requiring user approval because find is considered a "safe" pre-approved command. This means an attacker can achieve Remote Code Execution (RCE) by injecting malicious arguments (like -exec) into the args parameter, completely bypassing any human-in-the-loop safety mechanisms. Commit e22a1220f764e2d7cf9da6d6144926f53ca01cde contains a fix.