vanna vulnerable to remote code execution caused by prompt injection
The vanna.ask function executes LLM-generated code without a sandbox, so an attacker can use prompt injection to make the LLM produce malicious code that runs on the server. This allows remote code execution and potentially full server control.
vanna
Originally disclosed on huntr
In the latest version of vanna-ai/vanna, the vanna.ask function is vulnerable to remote code execution due to prompt injection. The root cause is the lack of a sandbox when executing LLM-generated code, allowing an attacker to manipulate the code executed by the exec function in src/vanna/base/base.py. This vulnerability can be exploited by an attacker to achieve remote code execution on the app backend server, potentially gaining full control of the server.
From the GitHub Advisory Database (GHSA-rrqq-fv6m-692m, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application executes code generated by a large language model using the exec function without any sandboxing or validation.
Impact
An attacker could achieve remote code execution on the backend server and potentially gain full control of it.
What the attacker needed
Access to vanna.ask function; ability to influence LLM prompt
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This tool asks an AI to write code and then runs that code on the server. Because there is no safety check, someone can trick the AI into writing harmful code that the server then runs, giving the attacker control. This is called remote code execution.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.