CVE-2024-4181
High · 8.8CVSS
8.8
EPSS
2.1%
Published
May 16, 2024
CISA due date
—
Cloudanix analysis
A bug in a widely used AI helper library lets anyone running the AI model server take over the computers of people who connect to it.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- Library
- Class
- RCE
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Improper use of Python eval in RunGptLLM class permits a malicious LLM provider to inject and execute arbitrary OS commands on the connecting client.
Why it matters to the business
Organizations relying on llama_index for LLM integrations face full remote takeover of client machines, resulting in data theft, service disruption, and potential supply-chain compromise of AI workloads.
How an attack unfolds
An attacker hosts or compromises an LLM endpoint used by RunGptLLM; when the client library processes a crafted response, the embedded eval executes attacker-supplied commands, granting shell access.
How to fix it
Upgrade run-llama/llama_index to version 0.10.13 or later; apply commit d73715eaf0642705583e7897c78b9c8dd2d3a7ba or 6d642a0893aced9bed026c5c15e17c41575ca024; audit all downstream dependents that pin an older revision.
How to confirm the fix worked
Verify the installed llama_index version is 0.10.13 or newer; inspect source for removal of the eval usage inside RunGptLLM; run integration tests against a controlled malicious endpoint to confirm command execution is blocked.
Typical attack path
- Attacker registers or compromises an LLM provider reachable by the target client
- Client configures RunGptLLM to connect to the attacker-controlled endpoint
- Malicious provider returns a payload that reaches the vulnerable eval call
- Arbitrary commands execute on the client with the privileges of the running process
- Attacker establishes persistence or exfiltrates data from the compromised host
How to detect it
Search application and system logs for unexpected process creation or command execution originating from Python processes that import llama_index; review network logs for connections to untrusted LLM endpoints; inspect code for direct use of RunGptLLM with external providers.
- RunGptLLM
- llama_index.*0\.9\.47
- eval(
What your security team should do
- Immediately upgrade all instances of llama_index to a fixed revision
- Inventory and patch every project that depends on the vulnerable package
- Restrict outbound LLM endpoints to trusted providers only
- Monitor for anomalous child processes spawned by Python processes using llama_index
The record
A command injection vulnerability exists in the RunGptLLM class of the llama_index library, version 0.9.47, used by the RunGpt framework from JinaAI to connect to Language Learning Models (LLMs). The vulnerability arises from the improper use of the eval function, allowing a malicious or compromised LLM hosting provider to execute arbitrary commands on the client's machine. This issue was fixed in version 0.10.13. The exploitation of this vulnerability could lead to a hosting provider gaining full control over client machines.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| PyPI | llama-index | 0 | 0.10.13 |
| PyPI | llama-index-llms-rungpt | 0 | 0.1.3 |
Related vulnerabilities
- CVE-2025-7707 llama-index has Insecure Temporary File Also affects llama-index
- CVE-2025-6211 LlamaIndex vulnerable to data loss through hash collisions in its DocugamiReader class Also affects llama-index
- CVE-2025-1793 llama_index vulnerable to SQL Injection Also affects llama-index
- CVE-2024-12911 LlamaIndex vulnerable to Creation of Temporary File in Directory with Insecure Permissions Also affects llama-index
- CVE-2024-12910 LlamaIndex Uncontrolled Resource Consumption vulnerability Also affects llama-index
- CVE-2024-23751 LlamaIndex (aka llama_index) through 0.9.34 allows SQL injection via the Text-to-SQL… Also affects llama-index
- CVE-2026-63378 TAKO AI Agent for Okta is a local-first AI agent that helps Okta administrators query… CWE-94
- CVE-2026-63346 Refitter is a tool for generating a C# REST API client using the Refit library. CWE-94