CVE-2024-4181: Llama index RunGptLLM Class Vulnerability
HIGHCVE-2024-4181 is a HIGH (CVSS 8.8) rungptllm class vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Llama index libraries in the PyPI ecosystem. The issue involves rungptllm class in llamaindex has a command injection. Remediation is available by upgrading affected packages to version 0.10.13, 0.1.3.
CVE-2024-4181 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-4181
To remediate this vulnerability, upgrade all affected Llama index dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install llama-index>=0.10.13
pip install llama-index-llms-rungpt>=0.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show llama-index
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-4181, inspect your installed packages using pip:
pip show llama-index
Analyze the terminal output to locate any version of Llama index in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.10.13), your application is affected.
Note: The pip show llama-index command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Llama index, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-4181 Affected Llama index Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
llama-index
|
PyPI |
< 0.10.13
|
0.10.13
|
|
llama-index-llms-rungpt
|
PyPI |
< 0.1.3
|
0.1.3
|
References
Frequently Asked Questions
What is CVE-2024-4181?
Which Llama index versions are affected?
What version fixes CVE-2024-4181?
Is llama-index affected?
Is llama-index-llms-rungpt affected?
What is the CVSS score of CVE-2024-4181?
What CWE is associated with CVE-2024-4181?
How can I check PyPI dependencies for CVE-2024-4181?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pw38-xv9x-h8ch",
"modified" : "2024-05-16T17:47:36Z",
"published" : "2024-05-16T09:33:08Z",
"aliases" : [ "CVE-2024-4181" ],
"summary" : "RunGptLLM class in LlamaIndex has a command injection",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "llama-index"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.10.13"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "llama-index-llms-rungpt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.1.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-4181"
}, {
"type" : "WEB",
"url" : "https://github.com/run-llama/llama_index/commit/d73715eaf0642705583e7897c78b9c8dd2d3a7ba"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/run-llama/llama_index"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/1a204520-598a-434e-b13d-0d34f2a5ddc1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-16T17:47:36Z",
"nvd_published_at" : "2024-05-16T09:15:15Z"
}
}