CVE-2024-5826
Published: 27 June 2024
Summary
CVE-2024-5826 is a critical-severity Code Injection (CWE-94) vulnerability. Its CVSS base score is 9.8 (Critical).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploit Public-Facing Application (T1190); ranked in the top 8.0% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.
This vulnerability is AI-related — categorised as Enterprise AI Assistants; in the LLM/Generative AI Risks risk domain; MITRE ATLAS techniques in scope: LLM Prompt Injection (AML.T0051).
Deeper analysis
The vulnerability affects the latest version of the vanna-ai/vanna library and centers on the vanna.ask function. It stems from insufficient sandboxing around LLM-generated code that is passed directly to Python's exec function in src/vanna/base/base.py, enabling remote code execution through prompt injection (CWE-94). The issue carries a CVSS 3.0 score of 9.8.
An unauthenticated remote attacker can supply a crafted prompt that causes the library to generate and execute arbitrary Python code on the application backend. Successful exploitation grants full control of the server, including the ability to read, modify, or delete data and potentially pivot within the environment.
The two referenced advisories at huntr.com describe the same root cause but do not detail patches or configuration changes. The associated EPSS score has remained flat at 0.0748 with no material increase since disclosure.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2024-2162
Vulnerability details
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…
more
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.
- CWE(s)
AI Security AnalysisAI
- AI Category
- Enterprise AI Assistants
- Risk Domain
- LLM/Generative AI Risks
- OWASP Top 10 for LLMs 2025
- None mapped
- Classification Reason
- Vanna-ai/vanna is an AI SQL agent platform that uses LLMs to generate and execute code for database queries, fitting the Enterprise AI Assistants category as it enables conversational AI interactions for enterprise data tasks.
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
The prompt injection vulnerability in vanna.ask enables remote code execution by executing unsandboxed LLM-generated Python code via exec(), facilitating exploitation of public-facing applications and adversary execution using the Python interpreter.
MITRE ATLAS TechniquesAI
MITRE ATLAS techniques
Affected Assets
Mitigating Controls
Likely Mitigating Controls AI
Per-CVE control mapping for this CVE has not run yet; the list below is derived from the weakness types (CWEs) cited in the NVD entry.
Makes persistent code injection into loaded programs impossible when the executable image itself resides on hardware-protected read-only media.
Dynamically generated code can be produced and executed inside the isolated chamber, preventing host compromise from code-injection payloads.
Validates inputs used in dynamic code generation to block injected directives.
Directly prevents execution of attacker-supplied code written into data memory regions.