NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Vanna

CVE-2024-5565: Vanna prompt injection code execution

criticalCVSS 4.0 9.2 · 3.1 8.1GHSA-7735-w2jp-gvg6

Vanna, a text-to-SQL library, can be tricked by prompt injection into running attacker-written Python when its `ask` method receives external input with `visualize` on, which is the default. That gives remote code execution on the host. Versions up to 0.5.5 are listed, with no patched version.

Published May 31, 2024 · Updated Nov 25, 2024 · Analysis Nov 2, 2026

What an attacker can do

Vanna asks a language model to write the code that plots query results. The attacker's text goes into that prompt. By injecting instructions, the attacker makes the model return arbitrary Python in place of plotting code, and the library runs it. JFrog's write-up names only the ask method and its visualize argument. It does not show the internal functions, so the point of execution is inferred from the advisory description.

The conditions are simple: external input reaches ask, and visualize is True. JFrog's proof of concept used VannaDefault on a SQLite database. An injected string made the model emit code that printed the working directory, which proves execution.

The attacker needs no account if your app lets users type questions into a chat or BI front end. Code runs with the privileges of the Vanna process, so database credentials, API keys and the host are exposed. The CVSS 4.0 vector shows a network attack with high impact on confidentiality, integrity and availability, with an attack-requirements flag because the model must cooperate.

Who is affected

pip package vanna 0.5.5 and earlier. Only apps that pass user-controlled text to ask with visualize=True (the default) are reachable.

pip show vanna

Search your code for .ask( calls on Vanna objects.

vanna

Ecosystem
PyPI
Affected
<= 0.5.5
Fixed in
No patched version yet
Check
pip show vanna

How to fix it

The advisory lists no patched version. JFrog's only mitigation is to set visualize to False whenever external input reaches ask.

vn.ask(question, visualize=False)

Beyond that, run the app as a low-privilege user in a container with no network egress and no standing secrets. Put authentication in front of any public question box.

How to tell if you were hit

Look in application logs for questions that contain instruction-like text, such as "ignore previous" or Python statements like import os. Check for child processes started by the app, unexpected file reads, or outbound connections after a question is asked. Review the generated plotting code, if you log it, for anything other than plotting calls.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

The Vanna library uses a prompt function to present the user with visualized results, it is possible to alter the prompt using prompt injection and run arbitrary Python code instead of the intended visualization code. Specifically - allowing external input to the library’s “ask” method with "visualize" set to True (default behavior) leads to remote code execution.

Questions

Does `visualize=False` fully protect me?

JFrog names it as the mitigation for this flaw. It removes the plotting-code path described in the advisory.

Is there a fixed Vanna version?

None is listed. The affected range is 0.5.5 and earlier.

Is it exploited in the wild?

No source says so, and it is not in CISA's KEV catalog. A proof of concept is published by JFrog.

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

More Vanna vulnerabilities

All Vanna entries