CVE-2024-7764
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedVanna-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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceVanna-ai v0.6.2 contains a SQL injection vulnerability in the `generate_sql` function's processing of LLM responses. Attackers can inject arbitrary SQL commands by including a semicolon in search data fields, causing the `extract_sql` function to strip the legitimate LLM-generated SQL and execute the attacker's command if it passes the `is_sql_valid` validation function. This allows SQL execution beyond the trained schema boundaries.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify Vanna-ai installation and versionLocate the Vanna package in your environment (typically via pip list, package.json, or project dependencies) and verify the installed version number matches 0.6.2Affected if The installed version is exactly 0.6.2 or falls within the affected range around v0.6.2
-
Verify generate_sql function is in useSearch your codebase for imports or calls to the generate_sql function from Vanna (often found in API endpoints, chat handlers, or SQL generation modules)Affected if Your application code calls generate_sql to convert LLM responses into executable SQL queries
-
Inspect is_sql_valid function implementationLocate the is_sql_valid validation function in your Vanna installation or codebase and examine whether it rejects queries with semicolon separators or queries outside trained schemasAffected if The is_sql_valid function is absent, permissive, or fails to block semicolon-separated statements
-
Check input sanitization for search data fieldsReview how user-provided search data reaches the LLM prompt - examine the data flow from user input to the generate_sql function and look for any semicolon character filtering or escapingAffected if User search data fields are passed to generate_sql without blocking or escaping semicolon characters
-
Test for SQL injection via semicolon injectionSubmit a test query containing a semicolon followed by a simple SQL command (e.g., 'test; SELECT 1') through your Vanna interface and observe if the second statement executesAffected if The system executes multiple SQL statements when semicolons are present in search data
You are affected if running Vanna-ai v0.6.2 (or equivalent version) with generate_sql in use and without proper semicolon blocking in input sanitization or strict schema validation in is_sql_valid.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
From vendor dataImplement strict input sanitization to block or escape semicolon characters in user search data before it reaches the LLM prompt, and enhance the `is_sql_valid` function to reject queries containing multiple statement separators or queries targeting schemas outside the trained context.
- Consultation6.0 h
- Implementation12.0 h
- Testing10.0 h
- Review / QA4.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $8,928.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2024-7764 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2024-7764 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data