{"answers":{"affected":"3 open source packages ship an affected version, including llama-index-core.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-3098 exists.","fix":"Upgrade llama-index-core to 0.10.24 or later.","what":"CVE-2024-3098 is a critical code injection vulnerability in run-llama/llama_index, published on 10 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-3098 and fix it if it is affected.\n\nWhat it is: CVE-2024-3098 is a critical code injection vulnerability in run-llama/llama_index, published on 10 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-3098 exists.\n\nAffected packages and fixed versions:\n- llama-index-core (PyPI): affected all versions; fixed in 0.10.24\n- llama-index-core (PyPI): affected all versions; fixed in 0.10.24\n- llama-index-core (PyPI): affected all versions; fixed in 0.10.24\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-3098/ (Markdown: https://insights.sbomify.com/CVE-2024-3098/index.md)","id":"CVE-2024-3098","markdown":"https://insights.sbomify.com/CVE-2024-3098/index.md","name":"CVE-2024-3098","record":{"aliases":["GHSA-wvpx-g427-q9wc","PYSEC-2026-397"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Python LLM library","requires_auth":"none","summary":"Attackers can execute arbitrary code via prompt injection in the safe_eval function of the llama_index library.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Prompt Injection leading to Arbitrary Code Execution in run-llama/llama_index","id":"CVE-2024-3098","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2024"},"n_packages":3,"n_references":2,"next":{"headline":"Denial of Service and Data Model Poisoning via URL Encoding in mlflow/mlflow","id":"CVE-2024-3099"},"packages":[{"ecosystem":"PyPI","fixed":["0.10.24"],"introduced":["0"],"last_affected":[],"package":"llama-index-core","purl":null,"source":"GHSA-wvpx-g427-q9wc"},{"ecosystem":"PyPI","fixed":["0.10.24"],"introduced":["0"],"last_affected":[],"package":"llama-index-core","purl":"pkg:pypi/llama-index-core","source":"GHSA-wvpx-g427-q9wc"},{"ecosystem":"PyPI","fixed":["0.10.24"],"introduced":["0"],"last_affected":[],"package":"llama-index-core","purl":"pkg:pypi/llama-index-core","source":"PYSEC-2026-397"}],"prev":{"headline":"WordPress Gallery Plugin – NextGEN Gallery \u003c= 3.59 - Missing Authorization to Unauthenticated Information Disclosure","id":"CVE-2024-3097"},"products":["run-llama/llama_index"],"published":"2024-04-10","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2024-08-01","vendors":["run-llama"]},"summary":"Attackers can execute arbitrary code via prompt injection in the safe_eval function of the llama_index library.","url":"https://insights.sbomify.com/CVE-2024-3098/"}