CVE-2026-4229: Vanna has a SQL injection in the remove_training_data function
Vanna (vanna-ai) up to 2.0.2 has a SQL injection in remove_training_data in the legacy BigQuery vector store, src/vanna/legacy/google/bigquery_vector.py. The id sent to the Flask endpoint /api/v0/remove_training_data is placed into a DELETE statement by string formatting. No patched version is listed, and the vendor did not respond to the reporter.
Published Mar 16, 2026 · Updated Mar 17, 2026 · Analysis Oct 31, 2026
What an attacker can do
The legacy Flask route reads id from the JSON body and only checks that it is not None. It calls vn.remove_training_data(id=id), which reaches the BigQuery implementation. That method builds a DELETE statement with an f-string, with the id inside single quotes, and runs it through self.conn.query(...). A value that closes the quote and adds an always-true condition makes the WHERE clause match every row. The researcher describes this as wiping the whole training table, or deleting only one category of training data.
The default NoAuth class treats every request as logged in. A deployment that keeps it can be attacked without credentials by anyone who reaches the Flask app. The Training Data page of the frontend uses this same endpoint, so it is a live path in the legacy app.
The result is lost or quietly degraded training data, which disrupts the text-to-SQL assistant that depends on it. The report also suggests that error-based or blind techniques might reach other tables in the same BigQuery dataset, but it marks this as unverified. The report is a static code audit and shows no runtime test.
Other backends are not affected: the report says pgvector and Oracle use parameterized queries, and ChromaDB and OpenSearch use API calls.
Who is affected
The pip package vanna up to and including 2.0.2, only where the legacy BigQuery_VectorStore class is used and its Flask API is exposed. Check the version:
pip show vannaSearch your code for BigQuery_VectorStore, often combined with other classes by multiple inheritance, and for the legacy Flask app.
vanna
- Ecosystem
- PyPI
- Affected
- <= 2.0.2
- Fixed in
- No patched version yet
- Check
pip show vanna
How to fix it
No patched version is listed in the sources, and the vendor did not respond to the reporter. Watch the project for a release above 2.0.2. Until then, using the sources' details:
- Do not expose the legacy Flask API to untrusted networks.
- Replace the default NoAuth class with real authentication.
- Switch to a vector store that does not build SQL by string interpolation, such as pgvector or ChromaDB, as the report found those safe.
- Give the BigQuery service account only the rights it needs.
Keep a backup of your training data so you can restore it.
How to tell if you were hit
Look in the web server logs for POST requests to /api/v0/remove_training_data whose JSON id contains quotes, OR 1=1 style text or SQL keywords. In BigQuery job history, look for DELETE statements against the training table with unusual WHERE clauses. A sudden empty training table is a sign of an attack.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
A flaw has been found in vanna-ai vanna up to 2.0.2. This impacts the function remove_training_data of the file src/vanna/legacy/google/bigquery_vector.py. This manipulation of the argument ID causes sql injection. The attack can be initiated remotely. The exploit has been published and may be used. The vendor was contacted early about this disclosure but did not respond in any way.
Questions
- Is there a patched version of Vanna for CVE-2026-4229?
No. The sources list vanna up to 2.0.2 as affected and name no fixed release. The vendor did not respond to the reporter.
- Does it affect every Vanna deployment?
No. The flaw is in the legacy BigQuery vector store. The report says pgvector, Oracle, ChromaDB and OpenSearch backends do not build SQL by interpolation.
- Does the attacker need to log in?
Not with the default NoAuth class, which treats every request as authenticated. A deployment with real authentication on the Flask app would require a valid login.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
