CVE-2024-5753: Vanna vulnerable to SQL Injection
Vanna (`vanna`) 0.3.4 and earlier lets an unauthenticated remote user read arbitrary files on the server through SQL injection, using functions such as PostgreSQL's `pg_read_file()`. The attack goes through the bundled Flask API. The advisory lists no patched version, so limit who can reach the API.
Published Jul 5, 2024 · Updated Oct 15, 2025 · Analysis Nov 1, 2026
What an attacker can do
Vanna turns questions into SQL and runs the SQL against your database. Its Flask API exposes that SQL path. According to the advisory, the queries it exposes can be abused: an attacker sends SQL that calls file-reading functions like pg_read_file(), and the database returns the contents of local files such as /etc/passwd.
No login is needed, and the only requirement is network access to the Flask app. The file read happens with the rights of the database server process, so which files are readable depends on the database role Vanna connects with and on where the database runs. Config files, keys and credentials stored on that host are the usual targets. The CVSS vector scores confidentiality only; the sources do not describe writes or code execution. The CWE list pairs SQL injection (CWE-89) with exposure of sensitive information (CWE-200).
Who is affected
Affected: vanna <= 0.3.4 when its Flask API is exposed. Risk is highest when the connected PostgreSQL role is allowed to use file functions such as pg_read_file(), which normally need superuser or an explicit grant. Check the version:
pip show vannaThen check whether the Flask server is reachable from outside and which database role it uses.
vanna
- Ecosystem
- PyPI
- Affected
- <= 0.3.4
- Fixed in
- No patched version yet
- Check
pip show vanna
How to fix it
The advisory lists no patched version of vanna, so there is no upgrade that closes this. The sources give no vendor workaround. Practical steps, which are our suggestions and not vendor guidance:
- Do not expose the Vanna Flask API to untrusted networks, or put authentication in front of it.
- Connect Vanna to the database with a read-only role that has no superuser rights and no grant on
pg_read_file()or similar functions.
Watch the project for a fixed release and re-check the advisory.
How to tell if you were hit
Search database logs for statements that call pg_read_file, pg_ls_dir, lo_import or COPY ... FROM coming from the role Vanna uses. Check web logs of the Flask app for requests with SQL that is not something your users would generate, especially references to /etc/ paths. Unexpected reads of sensitive files by the database process point to abuse.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
vanna-ai/vanna version v0.3.4 is vulnerable to SQL injection in some file-critical functions such as pg_read_file(). This vulnerability allows unauthenticated remote users to read arbitrary local files on the victim server, including sensitive files like /etc/passwd, by exploiting the exposed SQL queries via a Python Flask API.
Questions
- Does CVE-2024-5753 need authentication?
No. The advisory says unauthenticated remote users can exploit it through the exposed Flask API.
- Is there a patched Vanna version?
None is listed. The affected range is
<= 0.3.4, with no fixed version in the advisory.- Does it only matter for PostgreSQL?
The advisory names
pg_read_file(), so PostgreSQL is the confirmed case. It does not say whether other databases are affected.
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
