Vulnerabilities in pkg:pypi/llama-index-llms-rungpt

PACKAGE
Advisory Identifier: GHSA-pw38-xv9x-h8ch
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/llama-index-llms-rungpt

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/llama-index-llms-rungpt. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pw38-xv9x-h8ch CVE-2024-4181 HIGH RunGptLLM class in LlamaIndex has a command injection

CVE-2024-4181 at a Glance

CVE Identifier CVE-2024-4181
GHSA Identifier GHSA-pw38-xv9x-h8ch
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Llama index
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

llama-index fixed: 0.10.13
pip install llama-index>=0.10.13
llama-index-llms-rungpt fixed: 0.1.3
pip install llama-index-llms-rungpt>=0.1.3
Verify Direct and Transitive Dependencies

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

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.

CVE-2024-4181 Affected Llama index Versions

2 component(s)
Fixed Versions:
0.10.130.1.3
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?
CVE-2024-4181 is a security vulnerability in Llama index involving RunGptLLM class in LlamaIndex has a command injection under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Llama index versions are affected?
Affected versions include releases prior to 0.10.13, 0.1.3 across affected packages: llama-index, llama-index-llms-rungpt.
What version fixes CVE-2024-4181?
Upgrading to 0.10.13, 0.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is llama-index affected?
Yes, llama-index is affected in releases prior to 0.10.13. Upgrade your dependency to 0.10.13 or later.
Is llama-index-llms-rungpt affected?
Yes, llama-index-llms-rungpt is affected in releases prior to 0.1.3. Upgrade your dependency to 0.1.3 or later.
What is the CVSS score of CVE-2024-4181?
CVE-2024-4181 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-4181?
CVE-2024-4181 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (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.).
How can I check PyPI dependencies for CVE-2024-4181?
Run the dependency tree command: 'pip show llama-index'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}