All vulnerabilities
HIGHAI/LLMexploited in the wild

CVE-2024-5565

Vanna.AI · vanna

Summary

The Vanna.AI text-to-SQL library exposes an ask() method that, with visualization enabled by default, pipes LLM output through a chain of SQL to Python code to a Plotly visualization rendered with exec(). An attacker supplying crafted natural-language input can use prompt injection to override the intended Plotly code and have arbitrary Python executed on the host, yielding remote code execution. The flaw, discovered by JFrog, affects versions up to and including 0.5.5 and is fixed in 0.5.6 or by disabling visualization for external input.

How to avoid it in your code

  • Upgrade vanna to 0.5.6 or later, or disable visualization for any external input.
  • Never pass LLM output to exec()/eval(); generate plots without dynamic code execution.
  • Treat natural-language input as untrusted data, not code, to the ask() pipeline.
  • Sandbox any code execution with least privilege and no network egress.
  • Validate/whitelist generated SQL and plot code before running.

References

Related vulnerabilities

All AI/LLM →