Code InjectionWeakness · CWE-94

CVE-2024-5826

CRITICAL · 9.8 CVSS v3.0 Published 2024-06-27
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The vanna.ask function in vanna-ai/vanna allows remote code execution through prompt injection. The vulnerability stems from the lack of sandboxing around LLM-generated code that gets executed via Python's exec() function in src/vanna/base/base.py, allowing attackers to execute arbitrary commands on the server.

MitigationImplement a secure sandboxing mechanism (such as Docker containers, gVisor, or a dedicated isolated execution environment) around the exec() call to prevent unauthorized system access, combined with input validation on the prompt injection vector.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify vanna installation and version
    Run 'pip show vanna' or check your requirements file to find the installed version of the vanna package
    Affected if The installed version is any version of vanna-ai/vanna that contains the exec() call in src/vanna/base/base.py without sandboxing
  2. Locate the vulnerable exec() call
    Inspect the file src/vanna/base/base.py and search for the exec() function call within the code path triggered by vanna.ask()
    Affected if The file contains an exec() call that executes LLM-generated code without a sandboxing wrapper (such as Docker, gVisor, or an isolated execution environment)
  3. Verify if user input reaches the ask() function
    Review your application code to determine whether user-supplied prompts are passed to vanna.ask()
    Affected if User-provided prompts or external data can be injected into the vanna.ask() function, which then gets processed by the LLM and executed via exec()
  4. Check for input sanitization or validation
    Review the code that handles prompts before passing them to vanna.ask() to see if any filtering, validation, or prompt injection mitigation is applied
    Affected if No input validation or sanitization is performed on prompts before they reach the LLM that generates the executed code
  5. Confirm execution environment isolation
    Examine the runtime environment where vanna executes (the Python process) to determine if it runs in an isolated container, VM, or restricted sandbox
    Affected if The vanna library executes in the same environment as other application components without process-level isolation

You are affected if vanna is installed and your application passes user-controlled input to vanna.ask() while the exec() call in src/vanna/base/base.py lacks sandboxing isolation.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Implement a secure sandboxing mechanism (such as Docker containers, gVisor, or a dedicated isolated execution environment) around the exec() call to prevent unauthorized system access, combined with input validation on the prompt injection vector.

Have this fixed Scoped from the published advisory
  • Consultation6.0 h
  • Implementation20.0 h
  • Testing10.0 h
  • Review / QA6.0 h
42.0 hours of engineering $7,380
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $11,808.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-5826 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-5826 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data