CVE-2024-5827 Arbitrary File Write by Prompt Injection via DuckDB SQL in vanna-ai/vanna
Attackers can exploit SQL injection in DuckDB integration to write arbitrary files, enabling remote code execution or backdoor installation.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2024-5827?
CVE-2024-5827 is a critical SQL injection vulnerability in vanna-ai/vanna, published on 28 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Vanna v0.3.4 is vulnerable to SQL injection in its DuckDB integration exposed to its Flask Web APIs. Attackers can inject malicious SQL training data and generate corresponding queries to write arbitrary files on the victim's file system, such as backdoor.php with contents `<?php system($_GET[0]); ?>`. This can lead to command execution or the creation of backdoors.
Weakness: CWE-89
Which versions are affected by CVE-2024-5827?
How do I fix CVE-2024-5827?
No fix has been published for CVE-2024-5827 yet. Limit exposure of the affected software until one is available.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2024-5827 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5827 exists.
Public exploit code: 1 Nuclei template.
Sources
Also known as GHSA-c89v-fg7j-r5qj.