CVE-2024-7764 SQL Injection in vanna-ai/vanna

High 8.1 Published Updated

An attacker can inject arbitrary SQL commands via user requests in the vanna-ai library, bypassing schema restrictions to read or modify data.

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

What is CVE-2024-7764?

CVE-2024-7764 is a high-severity SQL injection vulnerability in vanna-ai/vanna, published on 20 Mar 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Vanna-ai v0.6.2 is vulnerable to SQL Injection due to insufficient protection against injecting additional SQL commands from user requests. The vulnerability occurs when the `generate_sql` function calls `extract_sql` with the LLM response. An attacker can include a semi-colon between a search data field and their own command, causing the `extract_sql` function to remove all LLM generated SQL and execute the attacker's command if it passes the `is_sql_valid` function. This allows the execution of user-defined SQL beyond the expected boundaries, notably the trained schema.

Weakness: CWE-89

Which versions are affected by CVE-2024-7764?

How do I fix CVE-2024-7764?

No fix has been published for CVE-2024-7764 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-7764 being exploited?

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

Sources

Also known as GHSA-7g3f-q846-q9hx.

Is CVE-2024-7764 in your software?

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

Check your SBOMs for free