{"id":"CVE-2024-3271","kind":"vulnerability","aliases":["CVE-2024-3271","GHSA-r6gp-rff2-p3hf"],"related":[],"title":"llama-index-core Command Injection vulnerability","description":"A command injection vulnerability exists in the run-llama/llama_index repository, specifically within the safe_eval function. Attackers can bypass the intended security mechanism, which checks for the presence of underscores in code generated by LLM, to execute arbitrary code. This is achieved by crafting input that does not contain an underscore but still results in the execution of OS commands. The vulnerability allows for remote code execution (RCE) on the server hosting the application.","summary":"llama-index-core's safe_eval function checks LLM-generated code for underscores as its safety filter, and that check can be bypassed. An attacker who can influence the model's output or input can get arbitrary operating system commands run on the server hosting the application.","severity":"critical","cvss":9.8,"epss":0.02886,"exploited":false,"exploited_at":null,"products":[{"name":"llama-index-core","fixed":["0.10.24"],"affected":"< 0.10.24","ecosystem":"pypi"},{"name":"llamaindex","fixed":["0.10.26"],"affected":">= 0.10.6, < 0.10.26","ecosystem":"vendor"}],"ecosystems":["pypi","vendor"],"tags":["ai-apps","cwe-77","llama-index","package","python","rag"],"not_affected_if":["fixed-version","no-safe-eval-path"],"how_to_check":"- Check the installed version with `pip show llama-index-core`, and look for it in `requirements.txt` or `poetry.lock`.\n- Search the codebase for calls to `safe_eval` or code paths that pass LLM output into it.","fix":"- `llama-index-core` `0.10.24` (fixed version per the advisory data; earlier versions are affected).","status":"open","published_at":"2024-04-16T00:15:12+00:00","first_seen_at":"2026-11-16T15:22:27+00:00","triaged_at":"2026-11-16T15:23:24+00:00","updated_at":"2026-11-16T15:37:59+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T15:23:24Z","model":"claude-haiku-5-5","output":{"fix":"- `llama-index-core` `0.10.24` (fixed version per the advisory data; earlier versions are affected).","reach":"internet","title":"llama-index-core: safe_eval bypass lets LLM-generated code run OS commands","impact":"high","summary":"llama-index-core's safe_eval function checks LLM-generated code for underscores as its safety filter, and that check can be bypassed. An attacker who can influence the model's output or input can get arbitrary operating system commands run on the server hosting the application.","audience":"developers","category":"package","nicknames":[],"who_cares":["llama-index","python","ai-apps","rag"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"Arbitrary OS commands run on the server hosting the application.","analyst_note":"Confirm from the GHSA page which application inputs reach safe_eval by default and whether auth is required; the sources do not say.","how_to_check":"- Check the installed version with `pip show llama-index-core`, and look for it in `requirements.txt` or `poetry.lock`.\n- Search the codebase for calls to `safe_eval` or code paths that pass LLM output into it.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["fixed-version","no-safe-eval-path"],"who_is_affected":"Applications that use llama-index-core and pass LLM-generated or user-influenced text into the safe_eval code path are exposed, since the bypass depends on that path being reached. Applications that do not call safe_eval, or that run on a version at or above 0.10.24, are not affected by this advisory.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"critical"},"cost_usd":0.00076,"input_tokens":4659,"output_tokens":589,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2024':9A,17A '-3271':10A,18A '-77':28B '/llama_index':94C 'achiev':127C 'ai':25B 'ai-app':24B 'allow':148C 'app':26B 'applic':83B,159C 'arbitrari':73B,123C 'attack':61B,102C 'bypass':59B,104C 'check':43B,56B,110C 'code':47B,117C,124C,151C 'command':5A,76B,85C,145C 'contain':134C 'core':4A,22A,38B 'craft':129C 'cve':8A,16A 'cwe':27B 'eval':41B,100C 'execut':122C,142C,152C 'exist':88C 'filter':53B 'function':42B,101C 'generat':46B,118C 'get':72B 'ghsa':12A 'ghsa-r6gp-rff2-p3hf':11A 'host':81B,157C 'index':3A,21A,31B,37B 'influenc':64B 'inject':6A,86C 'input':70B,130C 'intend':106C 'llama':2A,20A,30B,36B,93C 'llama-index':29B 'llama-index-cor':1A,35B 'llama-index-core':19A 'llamaindex':23A 'llm':45B,120C 'llm-gener':44B 'mechan':108C 'model':66B 'oper':74B 'os':144C 'output':68B 'p3hf':15A 'packag':32B 'presenc':113C 'python':33B 'r6gp':13A 'rag':34B 'rce':153C 'remot':150C 'repositori':95C 'result':139C 'rff2':14A 'run':77B,92C 'run-llama':91C 'safe':40B,99C 'safeti':52B 'secur':107C 'server':80B,156C 'specif':96C 'still':138C 'system':75B 'underscor':49B,115C,136C 'vulner':7A,87C,147C 'within':97C","nicknames":[],"mitigations":[],"who_affected":"Applications that use llama-index-core and pass LLM-generated or user-influenced text into the safe_eval code path are exposed, since the bypass depends on that path being reached. Applications that do not call safe_eval, or that run on a version at or above 0.10.24, are not affected by this advisory.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["llamaindex","llamaindexcore"],"ptokens":["core","index","llama","llamaindex"],"labels":["aiapps","critical","cwe77","llamaindex","package","pypi","python","rag","vendor"],"campaign_type":null,"search_a":"'-2024':9A,17A '-3271':10A,18A 'command':5A 'core':4A,22A 'cve':8A,16A 'ghsa':12A 'ghsa-r6gp-rff2-p3hf':11A 'index':3A,21A 'inject':6A 'llama':2A,20A 'llama-index-cor':1A 'llama-index-core':19A 'llamaindex':23A 'p3hf':15A 'r6gp':13A 'rff2':14A 'vulner':7A","search_b":"'-77':28B 'ai':25B 'ai-app':24B 'app':26B 'applic':83B 'arbitrari':73B 'attack':61B 'bypass':59B 'check':43B,56B 'code':47B 'command':76B 'core':38B 'cwe':27B 'eval':41B 'filter':53B 'function':42B 'generat':46B 'get':72B 'host':81B 'index':31B,37B 'influenc':64B 'input':70B 'llama':30B,36B 'llama-index':29B 'llama-index-cor':35B 'llm':45B 'llm-gener':44B 'model':66B 'oper':74B 'output':68B 'packag':32B 'python':33B 'rag':34B 'run':77B 'safe':40B 'safeti':52B 'server':80B 'system':75B 'underscor':49B","search_c":"'/llama_index':94C 'achiev':127C 'allow':148C 'applic':159C 'arbitrari':123C 'attack':102C 'bypass':104C 'check':110C 'code':117C,124C,151C 'command':85C,145C 'contain':134C 'craft':129C 'eval':100C 'execut':122C,142C,152C 'exist':88C 'function':101C 'generat':118C 'host':157C 'inject':86C 'input':130C 'intend':106C 'llama':93C 'llm':120C 'mechan':108C 'os':144C 'presenc':113C 'rce':153C 'remot':150C 'repositori':95C 'result':139C 'run':92C 'run-llama':91C 'safe':99C 'secur':107C 'server':156C 'specif':96C 'still':138C 'underscor':115C,136C 'vulner':87C,147C 'within':97C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-04-16T00:15:12+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":1,"sources":[{"source":"ghsa","external_id":"GHSA-r6gp-rff2-p3hf","url":"https://github.com/advisories/GHSA-r6gp-rff2-p3hf","severity":"critical","published_at":"2024-04-16T00:30:34+00:00","modified_at":"2026-11-16T15:18:11+00:00","first_seen_at":"2026-11-16T15:22:27+00:00","fetched_at":"2026-11-16T15:26:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-3271","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-3271","severity":null,"published_at":"2024-04-16T00:15:12+00:00","modified_at":"2026-06-17T07:43:41+00:00","first_seen_at":"2026-11-16T15:37:59+00:00","fetched_at":"2026-11-16T15:37:59+00:00","note":null}],"documents":[{"id":170374,"url":"https://github.com/run-llama/llama_index/commit/5fbcb5a8b9f20f81b791c7fc8849e352613ab475","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170375,"url":"https://github.com/run-llama/llama_index/commit/2c92e88838a5f481d50840240b1dd3180066c6f5","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170679,"url":"https://huntr.com/bounties/9b32490e-7cf9-470e-8d49-ba083ae7a279","title":"Exploit: huntr.com","kind":"poc","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"poc","confidence":null,"note":"Exploit: huntr.com"}],"disclosures":[],"exploit_sources":[{"type":"poc","url":"https://huntr.com/bounties/9b32490e-7cf9-470e-8d49-ba083ae7a279"},{"type":"epss","score":0.02886,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-3271"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}