CVE-2026-4229: SQL Injection Vulnerability in Vanna Package
Summary
CVE-2026-4229: Vanna has a SQL injection in the remove_training_data function. Affects vanna versions < 2.0.2. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Vanna is an AI-driven package available on PyPI that facilitates machine learning operations, particularly in managing and processing training data. It is designed to streamline workflows for data scientists and developers by providing tools for data manipulation and analysis. However, versions up to 2.0.2 contain a critical vulnerability that exposes users to SQL injection attacks, potentially compromising the integrity of their databases.
Vulnerability Detail
A SQL injection vulnerability exists in the remove_training_data function of the Vanna package, specifically in the file src/vanna/legacy/google/bigquery_vector.py. This flaw arises from improper handling of the argument ID, allowing attackers to manipulate SQL queries executed by the application. The vulnerability can be exploited remotely, leading to unauthorized access to sensitive data or even complete database compromise. The issue has been acknowledged by the vendor, but no response was received regarding a fix.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary measure, users can sanitize inputs to the remove_training_data function to prevent SQL injection. This can be done by validating and escaping the ID parameter before it is used in any SQL queries. For example:
def safe_remove_training_data(id):
sanitized_id = escape_sql(id) # Implement escape_sql to sanitize input
# Proceed with the database operation using sanitized_id
Implementing input validation can help mitigate the risk until an upgrade is performed.
Conclusion
The SQL injection vulnerability in the Vanna package poses a significant risk to users, particularly those utilizing versions up to 2.0.2. It is crucial to update to the latest version to mitigate this risk. Additionally, implementing input validation can serve as a temporary workaround until the update is applied.
See every vulnerability recorded for vanna →
FAQ
The vulnerability is a SQL injection flaw that allows attackers to manipulate SQL queries through the remove_training_data function.
If you are using Vanna version 2.0.2 or earlier, your application is vulnerable. You can check your version using 'pip show vanna'.
Exploitation of this vulnerability can lead to unauthorized access to your database, data leakage, or even complete data loss.
Yes, you can use Vulert to monitor and alert for open-source vulnerabilities in your software. It requires no installation and uses your Pipfile.lock to provide real-time alerts.
You can use the Vulert playground at Vulert Scanner to check for vulnerabilities in your application without any signup.
Related vulnerabilities
Recent vulnerabilities recorded for vanna.