CVE-2024-4181 Command Injection in run-llama/llama_index

High 8.8 Published Updated

A malicious LLM provider can execute arbitrary commands on client machines via improper eval usage in the RunGptLLM class.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-4181?

CVE-2024-4181 is a high-severity code injection vulnerability in run-llama/llama_index, published on 16 May 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-94

Which versions are affected by CVE-2024-4181?

6 open source packages ship an affected version, including llama-index and llama-index-llms-rungpt. It affects 1 product.

PackageAffectedFixed in
llama-index PyPIAll versions0.10.13
llama-index PyPIAll versions0.10.13
llama-index PyPIFrom 0.9.470.10.13
llama-index-llms-rungpt PyPIAll versions0.1.3
llama-index-llms-rungpt PyPIAll versions0.1.3
llama-index-llms-rungpt PyPIAll versions0.1.3

Products include Llamaindex Llamaindex.

How do I fix CVE-2024-4181?

Upgrade llama-index to 0.10.13 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-4181 being exploited?

There is no known exploitation of CVE-2024-4181 in the wild and no public exploit code.

Sources

Also known as GHSA-pw38-xv9x-h8ch, PYSEC-2024-324, PYSEC-2026-1565.

Is CVE-2024-4181 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free