# CVE-2024-3098: llama-index-core Prompt Injection vulnerability leading to Arbitrary Code Execution

Source: https://junglewise.ai/threats/cve-2024-3098-llama-index-core-prompt-injection-vulnerability-leading-to  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-04-10  
License: CC BY 4.0 with a link back

CVE-2024-3098 · Severity: critical · CVSS 9.8 · Published 2024-04-10

A vulnerability was identified in the `exec_utils` class of the `llama_index` package, specifically within the `safe_eval` function, allowing for prompt injection leading to arbitrary code execution. This issue arises due to insufficient validation of input, which can be exploited to bypass method restrictions and execute unauthorized code. The vulnerability is a bypass of the previously addressed CVE-2023-39662, demonstrated through a proof of concept that creates a file on the system by exploiting the flaw.

Technologies: [llama-index-core (PyPI)](https://junglewise.ai/threats/technologies/llama-index-core). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-3098 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-3098 being exploited in the wild.

**How severe is CVE-2024-3098?** Critical severity, with a CVSS score of 9.8, published 10 April 2024.

**Which products and versions are affected?** llama-index-core (PyPI) < 0.10.24, ECOSYSTEM:introduced=0,fixed=0.10.24.

**Is there a fix for CVE-2024-3098?** Yes. llama-index-core (PyPI): upgrade to 0.10.24 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2024-3098?** Check whether you run llama-index-core (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- llama-index-core (PyPI): upgrade to 0.10.24 or later

  ```sh
  pip install "llama-index-core>=0.10.24"
  ```


## Affected products

- llama-index-core (PyPI) < 0.10.24, ECOSYSTEM:introduced=0,fixed=0.10.24

## Identifiers

- CVE-2024-3098
- GHSA-wvpx-g427-q9wc
- PYSEC-2026-397

## Related threats

- [PYSEC-2026-1560 - llama-index-core vulnerable to Uncontrolled Resource Consumption](https://junglewise.ai/threats/cve-2025-6208-llama-index-core-vulnerable-to-uncontrolled-resource-consumption)
- [PYSEC-2026-1562 - llama-index-core insecurely handles temporary files](https://junglewise.ai/threats/cve-2025-7647-llama-index-core-insecurely-handles-temporary-files)
- [PYSEC-2026-1561 - LlamaIndex affected by a Denial of Service (DOS) in JSONReader](https://junglewise.ai/threats/cve-2025-5302-llamaindex-affected-by-a-denial-of-service-dos-in-jsonreader)
- [PYSEC-2026-1558 - LlamaIndex vulnerable to Path Traversal attack through its encode_image function](https://junglewise.ai/threats/cve-2025-6209-llamaindex-path-traversal-in-encode-image-function)
- [PYSEC-2026-1559 - LlamaIndex vulnerable to DoS attack through uncontrolled recursive JSON parsing](https://junglewise.ai/threats/cve-2025-5472-llamaindex-vulnerable-to-dos-attack-through-uncontrolled-recursive)
