CVE-2024-12909 SQL Injection to RCE in run-llama/llama_index

Critical 10.0 Published Updated

Attackers can exploit SQL injection in the FinanceChatLlamaPack to achieve remote code execution via PostgreSQL large objects.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2024-12909?

CVE-2024-12909 is a critical SQL injection vulnerability in run-llama/llama_index, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A vulnerability in the FinanceChatLlamaPack of the run-llama/llama_index repository, versions up to v0.12.3, 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. The issue is fixed in version 0.3.0.

Weakness: CWE-89

Which versions are affected by CVE-2024-12909?

3 open source packages ship an affected version, including llama-index-packs-finchat. It affects 1 product.

PackageAffectedFixed in
llama-index-packs-finchat PyPIAll versions to 0.3.0None
llama-index-packs-finchat PyPIAll versions to 0.3.0None
llama-index-packs-finchat PyPIAll versions to 0.3.0None

Products include Llamaindex Llamaindex.

How do I fix CVE-2024-12909?

No fix has been published for CVE-2024-12909 yet. Limit exposure of the affected software until one is available.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2024-12909 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-12909 exists.

Sources

Also known as GHSA-x48g-hm9c-ww42, PYSEC-2026-398.

Is CVE-2024-12909 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free