/

CVE-2026-51911

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Vanna Plotly Figure Method

CVE-2026-51911

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code or Command Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vanna v2.0.2 contains a critical code injection vulnerability in VannaBase.get_plotly_figure that may allow attacker-controlled code or commands to execute. The risk is highest when an exposed application entry passes attacker-influenced data into this functionality without adequate validation or isolation.

Vanna v2.0.2 contains a critical code injection vulnerability in VannaBase.get_plotly_figure that may allow attacker-controlled code or commands to execute. The risk is highest when an exposed application entry passes attacker-influenced data into this functionality without adequate validation or isolation.

Affected context

The vulnerability occurs in the legacy Vanna base implementation, specifically the VannaBase.get_plotly_figure method. Deployments may be exposed when this method is reachable through an application, API, notebook service, or other entry point that permits untrusted users or external inputs to influence plot generation.

The vulnerability occurs in the legacy Vanna base implementation, specifically the VannaBase.get_plotly_figure method. Deployments may be exposed when this method is reachable through an application, API, notebook service, or other entry point that permits untrusted users or external inputs to influence plot generation.

Exploit preconditions

  • Attack surface: An application or service exposing functionality that invokes VannaBase.get_plotly_figure
  • Required access: Ability to reach the exposed entry and provide or influence relevant input
  • Trigger point: Processing of attacker-controlled data by the plot-generation method
  • Why exploitation is possible: Input is handled in a way that can cause it to be interpreted as executable code or commands rather than treated strictly as data
  • Attack surface: An application or service exposing functionality that invokes VannaBase.get_plotly_figure
  • Required access: Ability to reach the exposed entry and provide or influence relevant input
  • Trigger point: Processing of attacker-controlled data by the plot-generation method
  • Why exploitation is possible: Input is handled in a way that can cause it to be interpreted as executable code or commands rather than treated strictly as data

Why this happens

The underlying bug is an insufficient separation between data and executable logic in a plot-generation code path. When attacker-controlled input reaches a dynamic evaluation or command-capable operation without strict validation, an attacker may influence program behavior or execution. This maps to CWE-94, Improper Control of Generation of Code, because externally influenced content can affect generated or interpreted code.

The underlying bug is an insufficient separation between data and executable logic in a plot-generation code path. When attacker-controlled input reaches a dynamic evaluation or command-capable operation without strict validation, an attacker may influence program behavior or execution. This maps to CWE-94, Improper Control of Generation of Code, because externally influenced content can affect generated or interpreted code.

Potential impact

  • An attacker may execute arbitrary code within the Vanna application process.
  • An attacker could execute operating-system commands with the application's privileges.
  • Sensitive application data, credentials, or connected data sources may be exposed.
  • The affected service could be altered, disrupted, or used for lateral movement.
  • In multi-tenant deployments, other users or workloads may be impacted.
  • An attacker may execute arbitrary code within the Vanna application process.
  • An attacker could execute operating-system commands with the application's privileges.
  • Sensitive application data, credentials, or connected data sources may be exposed.
  • The affected service could be altered, disrupted, or used for lateral movement.
  • In multi-tenant deployments, other users or workloads may be impacted.

General mitigation guidance

Mitigation generally focuses on preventing untrusted input from reaching

dynamic code-generation or command-execution paths.

Common defensive patterns include:

  • Treating all external plot, query, and formatting input as untrusted data.
  • Replacing dynamic evaluation with fixed, allowlisted operations and structured APIs.
  • Applying strict input schemas, type checks, length limits, and allowlists for supported values.
  • Separating rendering logic from execution-capable functionality.
  • Running the service with least-privilege identities and restricting filesystem, network, and process permissions.
  • Isolating data-processing workers from sensitive systems and credentials.
  • Applying secure-by-default authorization controls to every exposed entry point.

Mitigation generally focuses on preventing untrusted input from reaching

dynamic code-generation or command-execution paths.

Common defensive patterns include:

  • Treating all external plot, query, and formatting input as untrusted data.
  • Replacing dynamic evaluation with fixed, allowlisted operations and structured APIs.
  • Applying strict input schemas, type checks, length limits, and allowlists for supported values.
  • Separating rendering logic from execution-capable functionality.
  • Running the service with least-privilege identities and restricting filesystem, network, and process permissions.
  • Isolating data-processing workers from sensitive systems and credentials.
  • Applying secure-by-default authorization controls to every exposed entry point.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying dynamic evaluation, shell invocation, template execution, or code-generation constructs near user-controlled data.
  • Code review checks for string concatenation or interpolation used to build executable expressions or commands.
  • Tests that submit unexpected types, delimiters, and malformed structured inputs to exposed plotting interfaces.
  • Runtime monitoring for unusual child processes, command interpreters, outbound connections, or access to sensitive files.
  • Policy enforcement that blocks unapproved execution APIs and requires review for code-generation features.
  • Automated security review tools that flag data-to-code flows for manual validation.

Organizations can look for this weakness through:

  • Static analysis rules identifying dynamic evaluation, shell invocation, template execution, or code-generation constructs near user-controlled data.
  • Code review checks for string concatenation or interpolation used to build executable expressions or commands.
  • Tests that submit unexpected types, delimiters, and malformed structured inputs to exposed plotting interfaces.
  • Runtime monitoring for unusual child processes, command interpreters, outbound connections, or access to sensitive files.
  • Policy enforcement that blocks unapproved execution APIs and requires review for code-generation features.
  • Automated security review tools that flag data-to-code flows for manual validation.

Sources

SourceLink
gist.github.comgist.github.com/Ro1ME/a259be3574844bc705316295b2406da0
github.comgithub.com/vanna-ai/vanna

Frequently asked

questions

It may be remotely exploitable when an application exposes the affected plotting

functionality through a network-accessible interface and accepts attacker-controlled

input. Exploitability depends on the specific integration and its access controls.

The attacker generally needs access to an entry point that invokes

VannaBase.get_plotly_figure and permits influence over the data or parameters

processed by that method. Authentication, authorization, and network exposure

determine the practical scope.

Ensure that untrusted input is never interpreted as executable code or commands.

Prefer structured, allowlisted plotting operations and enforce validation before

data reaches any dynamic execution path.

Use data-to-code static analysis, secure code review, strict input schemas,

least-privilege execution, process isolation, and monitoring for unexpected

command or child-process activity.

It may be remotely exploitable when an application exposes the affected plotting

functionality through a network-accessible interface and accepts attacker-controlled

input. Exploitability depends on the specific integration and its access controls.

The attacker generally needs access to an entry point that invokes

VannaBase.get_plotly_figure and permits influence over the data or parameters

processed by that method. Authentication, authorization, and network exposure

determine the practical scope.

Ensure that untrusted input is never interpreted as executable code or commands.

Prefer structured, allowlisted plotting operations and enforce validation before

data reaches any dynamic execution path.

Use data-to-code static analysis, secure code review, strict input schemas,

least-privilege execution, process isolation, and monitoring for unexpected

command or child-process activity.

Find out what's already
exploitable in your codebase.