INCIDENT MAP

Browse / Improper Output Handling / CVE-2024-3271

llama-index-core Command Injection vulnerability

CVE-2024-3271 ยท 2024-04-16 critical

Class
Improper Output Handling (filed by a model that read the advisory)
Technique
Code and command execution
Also involves
Direct Prompt Injection
Affected
llama-index-core (PyPI)
Gets past
Input filter or sanitiser
CVSS
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
2.9% chance of exploitation in 30 days

How it works, in short

Input crafted to make the LLM emit code avoids the underscore check in safe_eval, so generated expressions still run OS commands on the server. (Our summary, written by a model. The source text is below.)

Details

A command injection vulnerability exists in the run-llama/llama_index repository, specifically within the safe_eval function. Attackers can bypass the intended security mechanism, which checks for the presence of underscores in code generated by LLM, to execute arbitrary code. This is achieved by crafting input that does not contain an underscore but still results in the execution of OS commands. The vulnerability allows for remote code execution (RCE) on the server hosting the application.

References

Source: GitHub Advisory Database, used under CC BY 4.0.