/

CVE-2026-70477

Severity:

CRITICAL RISK

(9.8)

Python Code Injection (CWE-94) in Flowise CSV Agent

CVE-2026-70477

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code 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

A critical prompt-injection vulnerability in Flowise can cause a CSV Agent chatflow to generate Python code that bypasses blocklist validation and execute it in an unsandboxed Pyodide environment. An attacker who can submit input to an affected chatflow may achieve arbitrary code execution with the privileges of the Flowise service account.

A critical prompt-injection vulnerability in Flowise can cause a CSV Agent chatflow to generate Python code that bypasses blocklist validation and execute it in an unsandboxed Pyodide environment. An attacker who can submit input to an affected chatflow may achieve arbitrary code execution with the privileges of the Flowise service account.

Affected context

The issue affects Flowise deployments using a CSV Agent node in a chatflow where untrusted user input is incorporated into an LLM prompt and the generated Python code is subsequently executed. Risk is increased when the Pyodide environment is unsandboxed, validation relies on blocklists, and the service account has access to sensitive data or operational capabilities.

The issue affects Flowise deployments using a CSV Agent node in a chatflow where untrusted user input is incorporated into an LLM prompt and the generated Python code is subsequently executed. Risk is increased when the Pyodide environment is unsandboxed, validation relies on blocklists, and the service account has access to sensitive data or operational capabilities.

Exploit preconditions

  • Attack surface: A Flowise chatflow exposed through a user-accessible chat or API interface
  • Required access: Ability to submit prompt or chat input to a flow containing the vulnerable CSV Agent functionality
  • Trigger point: Processing of the CSV Agent's generated Python code before execution
  • Why exploitation is possible: LLM-generated code is derived from untrusted input, while blocklist-based validation may fail to identify harmful Python behavior and the runtime is not sufficiently sandboxed
  • Attack surface: A Flowise chatflow exposed through a user-accessible chat or API interface
  • Required access: Ability to submit prompt or chat input to a flow containing the vulnerable CSV Agent functionality
  • Trigger point: Processing of the CSV Agent's generated Python code before execution
  • Why exploitation is possible: LLM-generated code is derived from untrusted input, while blocklist-based validation may fail to identify harmful Python behavior and the runtime is not sufficiently sandboxed

Why this happens

The vulnerability results from treating LLM-generated Python code as executable logic after incorporating untrusted data into the prompt. The CSV_Agents run path validates the resulting code with a blocklist-oriented check that can be bypassed, then executes it in an unsandboxed Pyodide environment. This maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced input can affect code generation and execution without a sufficiently reliable safety boundary.

The vulnerability results from treating LLM-generated Python code as executable logic after incorporating untrusted data into the prompt. The CSV_Agents run path validates the resulting code with a blocklist-oriented check that can be bypassed, then executes it in an unsandboxed Pyodide environment. This maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced input can affect code generation and execution without a sufficiently reliable safety boundary.

Potential impact

  • Arbitrary code execution in the Flowise service context
  • Access to data available to the service account
  • Modification or deletion of accessible files and resources
  • Disclosure of environment variables, credentials, or application data
  • Further compromise of connected services or infrastructure
  • Arbitrary code execution in the Flowise service context
  • Access to data available to the service account
  • Modification or deletion of accessible files and resources
  • Disclosure of environment variables, credentials, or application data
  • Further compromise of connected services or infrastructure

General mitigation guidance

Mitigation generally focuses on preventing untrusted prompts from controlling executable code and eliminating reliance on blocklists as the primary security boundary.

Common defensive patterns include:

  • Avoiding execution of LLM-generated code whenever a non-code alternative is practical
  • Replacing blocklists with narrowly scoped allowlists, structured operations, and constrained execution interfaces
  • Running data-processing logic in a strongly isolated sandbox with restricted filesystem, network, and host access
  • Applying least privilege to the Flowise service account and separating chatflow execution identities from administrative identities
  • Treating user prompts, retrieved content, and CSV data as untrusted inputs
  • Enforcing resource limits, output validation, and explicit authorization before sensitive operations
  • Monitoring and restricting outbound connectivity from code-execution environments

Mitigation generally focuses on preventing untrusted prompts from controlling executable code and eliminating reliance on blocklists as the primary security boundary.

Common defensive patterns include:

  • Avoiding execution of LLM-generated code whenever a non-code alternative is practical
  • Replacing blocklists with narrowly scoped allowlists, structured operations, and constrained execution interfaces
  • Running data-processing logic in a strongly isolated sandbox with restricted filesystem, network, and host access
  • Applying least privilege to the Flowise service account and separating chatflow execution identities from administrative identities
  • Treating user prompts, retrieved content, and CSV data as untrusted inputs
  • Enforcing resource limits, output validation, and explicit authorization before sensitive operations
  • Monitoring and restricting outbound connectivity from code-execution environments

How teams detect issues like this

Organizations can look for:

  • Static analysis findings involving dynamic Python execution, generated-code execution, or weak blocklist validation
  • Code review signals where LLM output is passed directly to an interpreter or runtime
  • Chatflow configurations that expose CSV Agent nodes to untrusted users
  • Runtime telemetry showing unexpected interpreter activity, filesystem access, network connections, or service-account API calls
  • Policy checks requiring sandbox isolation and least-privilege identities for any user-influenced code execution
  • Automated security review tools that flag prompt-to-code execution paths and missing trust-boundary checks

Organizations can look for:

  • Static analysis findings involving dynamic Python execution, generated-code execution, or weak blocklist validation
  • Code review signals where LLM output is passed directly to an interpreter or runtime
  • Chatflow configurations that expose CSV Agent nodes to untrusted users
  • Runtime telemetry showing unexpected interpreter activity, filesystem access, network connections, or service-account API calls
  • Policy checks requiring sandbox isolation and least-privilege identities for any user-influenced code execution
  • Automated security review tools that flag prompt-to-code execution paths and missing trust-boundary checks

Sources

SourceLink
github.comgithub.com/FlowiseAI/Flowise/commit/f4e2794f6a576b94578f2fdafbf49c2fb304626c
github.comgithub.com/FlowiseAI/Flowise/pull/6499
github.comgithub.com/FlowiseAI/Flowise/releases/tag/flowise@3.1.3
github.comgithub.com/FlowiseAI/Flowise/security/advisories/GHSA-5xvg-pmgg-3mxr

Frequently asked

questions

It can be remotely exploitable when an attacker can submit prompts or other input to an exposed Flowise chatflow that uses the affected CSV Agent functionality.

The attacker generally needs access to interact with the vulnerable chatflow. Administrative access is not necessarily required if the flow accepts unauthenticated or low-privilege requests.

Prevent untrusted LLM output from being executed as Python. Where code execution is essential, use a strongly isolated sandbox, narrowly constrained operations, strict allowlists, and a least-privilege service identity.

Treat prompts and model output as untrusted, avoid blocklist-only validation, enforce prompt-to-code security policies, and continuously monitor execution environments for unexpected behavior.

It can be remotely exploitable when an attacker can submit prompts or other input to an exposed Flowise chatflow that uses the affected CSV Agent functionality.

The attacker generally needs access to interact with the vulnerable chatflow. Administrative access is not necessarily required if the flow accepts unauthenticated or low-privilege requests.

Prevent untrusted LLM output from being executed as Python. Where code execution is essential, use a strongly isolated sandbox, narrowly constrained operations, strict allowlists, and a least-privilege service identity.

Treat prompts and model output as untrusted, avoid blocklist-only validation, enforce prompt-to-code security policies, and continuously monitor execution environments for unexpected behavior.

Find out what's already
exploitable in your codebase.