CVE-2024-5826CWE-94

Remote Code Execution via Prompt Injection in vanna-ai/vanna

Critical · published June 27, 2024

CVSS v3.0
9.8
EPSS
1%
Percentile
58.8
In the wild
Unconfirmed
What it is

🔥 A crafty prompt injection could give attackers the keys to your server with the `vanna.ask` function! Think of this as a poorly supervised kitchen where anyone can sneak in a secret ingredient before the dish is served — it’s a recipe for disaster! Without a proper sandbox, maliciously crafted prompts can cause the system to execute any code an attacker sends, just like an unfiltered chef. An attacker could gain complete control over your backend server, execute arbitrary commands, and wreak absolute havoc on your application. This could lead to data breaches, service downtimes, or even worse — total server takeover! The consequences could be devastating for your organization and your users.

Put simply

Think of this as a poorly supervised kitchen where anyone can sneak in a secret ingredient before the dish is served — it’s a recipe for disaster! Without a proper sandbox, maliciously crafted prompts can cause the system to execute any code an attacker sends, just like an unfiltered chef. The vulnerability in vanna-ai/vanna arises from the lack of a sandbox in the `vanna.ask` function, allowing attackers to manipulate code executed by the `exec` function in `src/vanna/base/base.py`. This creates a pathway for remote code execution (RCE), enabling unauthorized access and control.

What to do

An attacker could gain complete control over your backend server, execute arbitrary commands, and wreak absolute havoc on your application. This could lead to data breaches, service downtimes, or even worse — total server takeover! The consequences could be devastating for your organization and your users. To mitigate this vulnerability, update vanna-ai/vanna to the latest version as soon as possible. Implement proper input validation and sandboxing for any user-generated code that will be executed. Regularly audit your applications for vulnerabilities and encourage secure coding practices among your developers. This is fixable! Follow these steps and you'll have your app locked down in no time. 🛡️

The record
Technical detail
CVSS v3.0
9.8 · CRITICAL
Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00882 · 58.8th percentile
Weakness
CWE-94 · Improper Control of Generation of Code ('Code Injection')
Published
2024-06-27T18:40Z
EPSS history
Timeline
  • 27 JUN 18:40Z
    Remote Code Execution via Prompt Injection in vanna-ai/vanna
    cvelistv5