{"id":"CVE-2024-12909","kind":"vulnerability","aliases":["CVE-2024-12909","GHSA-x48g-hm9c-ww42"],"related":[],"title":"llama-index-packs-finchat SQL Injection vulnerability","description":"A vulnerability in the FinanceChatLlamaPack of the llama-index-packs-finchat package, versions up to v0.3.0, allows for SQL injection in the `run_sql_query` function of the `database_agent`. This vulnerability can be exploited by an attacker to inject arbitrary SQL queries, leading to remote code execution (RCE) through the use of PostgreSQL's large object functionality.\n\nThe issue is resolved by no longer officially supporting the package and moving it into the `stale_packages` branch on the repo, this removing it from documentation etc.","summary":"The FinanceChatLlamaPack in the llama-index-packs-finchat PyPI package builds SQL in its database_agent run_sql_query function without sanitizing input, so an attacker can inject arbitrary SQL. Per the advisory, this can be chained through PostgreSQL large object functions to achieve remote code execution.","severity":"critical","cvss":10.0,"epss":0.01444,"exploited":false,"exploited_at":null,"products":[{"name":"llama-index-packs-finchat","fixed":[],"affected":"<= 0.3.0","ecosystem":"pypi"},{"name":"llamaindex","fixed":["0.3.0"],"affected":"< 0.3.0","ecosystem":"vendor"}],"ecosystems":["pypi","vendor"],"tags":["ai-agents","cwe-89","llama-index","package","postgresql","python"],"not_affected_if":["no-database-agent","not-using-finchat-pack","package-not-installed"],"how_to_check":"- Check whether `llama-index-packs-finchat` is installed: `pip show llama-index-packs-finchat`\n- Look for the package in requirements files, lock files or pyproject.toml\n- Confirm the installed version is `0.3.0` or lower to be affected","fix":null,"status":"open","published_at":"2025-03-20T10:15:31+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","triaged_at":"2026-11-16T15:19:16+00:00","updated_at":"2026-11-16T15:37:59+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-16T15:19:16Z","model":"claude-haiku-5-5","output":{"fix":"unknown","reach":"unknown","title":"llama-index-packs-finchat: SQL injection in run_sql_query allows remote code execution","impact":"high","summary":"The FinanceChatLlamaPack in the llama-index-packs-finchat PyPI package builds SQL in its database_agent run_sql_query function without sanitizing input, so an attacker can inject arbitrary SQL. Per the advisory, this can be chained through PostgreSQL large object functions to achieve remote code execution.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","llama-index","ai-agents","postgresql"],"confidence":0.7,"fix_status":"none","needs_auth":"unknown","worst_case":"attacker runs arbitrary SQL and code on the database server","analyst_note":"Advisory states the package is unsupported and removed from docs; confirm whether any fixed release exists and whether the vulnerable path is reachable from untrusted input.","how_to_check":"- Check whether `llama-index-packs-finchat` is installed: `pip show llama-index-packs-finchat`\n- Look for the package in requirements files, lock files or pyproject.toml\n- Confirm the installed version is `0.3.0` or lower to be affected","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["package-not-installed","no-database-agent","not-using-finchat-pack"],"who_is_affected":"Teams that installed the llama-index-packs-finchat package, which is affected up to and including version 0.3.0, and that expose its database_agent to untrusted input. The maintainers resolved it by no longer supporting the package and moving it to a stale_packages branch, so no patched release is stated. Teams that do not use this pack can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000786,"input_tokens":4693,"output_tokens":634,"severity_before":"critical"},"analyst_status":"queued","analyst_note":"Advisory states the package is unsupported and removed from docs; confirm whether any fixed release exists and whether the vulnerable path is reachable from untrusted input.","search":"'-12909':11A,19A '-2024':10A,18A '-89':30B 'achiev':81B 'advisori':70B 'agent':28B,53B,115C 'ai':27B 'ai-ag':26B 'allow':102C 'arbitrari':66B,126C 'attack':63B,123C 'branch':162C 'build':48B 'chain':74B 'code':83B,132C 'cve':9A,17A 'cwe':29B 'databas':52B,114C 'document':170C 'etc':171C 'execut':84B,133C 'exploit':120C 'financechatllamapack':38B,89C 'finchat':5A,24A,45B,96C 'function':57B,79B,111C,143C 'ghsa':13A 'ghsa-x48g-hm9c-ww42':12A 'hm9c':15A 'index':3A,22A,33B,43B,94C 'inject':7A,65B,105C,125C 'input':60B 'issu':145C 'larg':77B,141C 'lead':129C 'llama':2A,21A,32B,42B,93C 'llama-index':31B 'llama-index-packs-finchat':1A,20A,41B,92C 'llamaindex':25A 'longer':150C 'move':156C 'object':78B,142C 'offici':151C 'pack':4A,44B,95C 'packag':34B,47B,97C,154C,161C 'packs':23A 'per':68B 'postgresql':35B,76B,139C 'pypi':46B 'python':36B 'queri':56B,110C,128C 'rce':134C 'remot':82B,131C 'remov':167C 'repo':165C 'resolv':147C 'run':54B,108C 'sanit':59B 'sql':6A,49B,55B,67B,104C,109C,127C 'stale':160C 'support':152C 'use':137C 'v0.3.0':101C 'version':98C 'vulner':8A,86C,117C 'without':58B 'ww42':16A 'x48g':14A","nicknames":[],"mitigations":[],"who_affected":"Teams that installed the llama-index-packs-finchat package, which is affected up to and including version 0.3.0, and that expose its database_agent to untrusted input. The maintainers resolved it by no longer supporting the package and moving it to a stale_packages branch, so no patched release is stated. Teams that do not use this pack can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"none","audience":"developers","plain_action":null,"pkeys":["llamaindex","llamaindexpacksfinchat"],"ptokens":["finchat","index","llama","llamaindex","packs"],"labels":["aiagents","critical","cwe89","llamaindex","package","postgresql","pypi","python","vendor"],"campaign_type":null,"search_a":"'-12909':11A,19A '-2024':10A,18A 'cve':9A,17A 'finchat':5A,24A 'ghsa':13A 'ghsa-x48g-hm9c-ww42':12A 'hm9c':15A 'index':3A,22A 'inject':7A 'llama':2A,21A 'llama-index-packs-finchat':1A,20A 'llamaindex':25A 'pack':4A 'packs':23A 'sql':6A 'vulner':8A 'ww42':16A 'x48g':14A","search_b":"'-89':30B 'achiev':81B 'advisori':70B 'agent':28B,53B 'ai':27B 'ai-ag':26B 'arbitrari':66B 'attack':63B 'build':48B 'chain':74B 'code':83B 'cwe':29B 'databas':52B 'execut':84B 'financechatllamapack':38B 'finchat':45B 'function':57B,79B 'index':33B,43B 'inject':65B 'input':60B 'larg':77B 'llama':32B,42B 'llama-index':31B 'llama-index-packs-finchat':41B 'object':78B 'pack':44B 'packag':34B,47B 'per':68B 'postgresql':35B,76B 'pypi':46B 'python':36B 'queri':56B 'remot':82B 'run':54B 'sanit':59B 'sql':49B,55B,67B 'without':58B","search_c":"'agent':115C 'allow':102C 'arbitrari':126C 'attack':123C 'branch':162C 'code':132C 'databas':114C 'document':170C 'etc':171C 'execut':133C 'exploit':120C 'financechatllamapack':89C 'finchat':96C 'function':111C,143C 'index':94C 'inject':105C,125C 'issu':145C 'larg':141C 'lead':129C 'llama':93C 'llama-index-packs-finchat':92C 'longer':150C 'move':156C 'object':142C 'offici':151C 'pack':95C 'packag':97C,154C,161C 'postgresql':139C 'queri':110C,128C 'rce':134C 'remot':131C 'remov':167C 'repo':165C 'resolv':147C 'run':108C 'sql':104C,109C,127C 'stale':160C 'support':152C 'use':137C 'v0.3.0':101C 'version':98C 'vulner':86C,117C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2025-03-20T10:15:31+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":1,"sources":[{"source":"ghsa","external_id":"GHSA-x48g-hm9c-ww42","url":"https://github.com/advisories/GHSA-x48g-hm9c-ww42","severity":"critical","published_at":"2025-03-20T12:32:44+00:00","modified_at":"2026-11-16T15:13:30+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","fetched_at":"2026-11-16T15:26:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-12909","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-12909","severity":null,"published_at":"2025-03-20T10:15:31+00:00","modified_at":"2026-06-17T07:00:44+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":170364,"url":"https://github.com/run-llama/llama_index/commit/5d03c175476452db9b8abcdb7d5767dd7b310a75","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170684,"url":"https://huntr.com/bounties/44e8177f-200a-4ba3-a12c-8bc21e313a3f","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/44e8177f-200a-4ba3-a12c-8bc21e313a3f"},{"type":"epss","score":0.01444,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-12909"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}