Krytyczna

Flowise: CSV Agent Prompt Injection Remote Code Execution Vulnerability

  • Ujawniono: 04.08.2026
  • Aktualizacja: 11.10.2026 10:22

-- ABSTRACT -------------------------------------

Trend Micro's Zero Day Initiative has identified a vulnerability affecting the following products: Flowise - Flowise

-- VULNERABILITY DETAILS ------------------------


A prompt injection sent to a chatflow using a CSV Agent node can cause the LLM to respond with a malicious Python script that bypasses the blocklist validator and executes in an unsandboxed pyodide environment. An attacker can leverage this to execute arbitrary code in the context of the user running the server.

This vulnerability allows remote attackers to execute arbitrary code on affected installations of Flowise. Authentication is not required to exploit this vulnerability.

The specific flaw exists within the run method of the CSV_Agents class. The issue results from insufficient input sanitization when using untrusted data to construct an LLM prompt. An attacker can leverage this vulnerability to execute code in the context of the service account.

Analysis

When a user makes a query against a chatflow using the CSV Agent node, the run method of the CSV_Agents class is called. This method reads the CSV file, loads a pyodide environment, and uses pandas to extract column names and data types into a dictionary. It then constructs a system prompt using that dictionary and the user's input, and sends this prompt to a configured LLM. The LLM response is stored in a variable named pythonCode. The method then attempts to validate this value using validatePythonCodeForDataFrame from packages/components/src/pythonCodeValidator.ts before evaluating it in pyodide.

The validator relies on a static regex blocklist. It can be bypassed using obfuscation techniques including string concatenation to reconstruct forbidden identifiers, chr() encoding, aliasing of dangerous builtins, __getattribute__ with concatenated attribute names, frame object inspection, MRO traversal, df.query() expression evaluation, and decorator syntax to invoke exec indirectly. Furthermore, pyodide is not sandboxed from the host operating system, so any Python code that passes the validator is executed with full access to OS interfaces.

From packages/components/nodes/agents/CSVAgent/CSVAgent.ts:

ts
let pythonCode = ''
if (dataframeColDict) {
    const chain = new LLMChain({
        llm: model,
        prompt: PromptTemplate.fromTemplate(systemPrompt),
        verbose: process.env.DEBUG === 'true' ? true : false
    })
    const inputs = {
        dict: dataframeColDict,
        question: input // user-controlled input substituted into prompt
    }
    const res = await chain.call(inputs, [loggerHandler, ...callbacks])
    pythonCode = res?.text // LLM response assigned to pythonCode
    pythonCode = pythonCode.replace(/^```[a-z]+\n|\n```$/gm, '')
}

let finalResult = ''
if (pythonCode) {
    const validation = validatePythonCodeForDataFrame(pythonCode) // blocklist validation applied
    if (!validation.valid) {
        throw new Error(
            `Generated code was rejected for security reasons (${
                validation.reason ?? 'unsafe construct'
            }). Please rephrase your question to use only pandas DataFrame operations.`
        )
    }
    try {
        const code = `import pandas as pd\nimport numpy as np\n${pythonCode}`
        finalResult = await pyodide.runPythonAsync(code) // executed in unsandboxed pyodide
    } catch (error) {
        throw new Error(`Sorry, I'm unable to find answer for question: "${input}" using following code: "${pythonCode}"`)
    }
}

An unauthenticated attacker with the ability to send prompts to a chatflow using the CSV Agent node may use prompt injection to cause the LLM to respond with a malicious Python script. An authenticated attacker may instead configure a chatflow that points to an attacker-controlled server, which responds to LLM requests with an attacker-controlled Python payload, bypassing the LLM entirely.

Eight bypass variants were demonstrated against the validator:

Variant Technique Bypasses
0 @exec decorator with string-concatenated __import__ /\bexec\s*\(/, /\b__import__\s*\(/
1 eval aliased to a variable, payload chr()-encoded /\beval\s*\(/, /\bimport\b/
2 df.query() with chr()-encoded @__builtins__.__import__ /\b__builtins__\b/, /\b__import__\s*\(/
3 MRO traversal + __getattribute__ + __subclasses__ -> BuiltinImporter.load_module /\b__class__\b/, /\b__subclasses__\s*\(/, /\b__mro__\b/
4 Generator frame inspection via gi_frame.f_globals['__loader__'] /\b__loader__\b/, /\b__globals__\b/
5 Exception traceback frame walk to f_builtins['__import__'] /\b__globals__\b/, /\b__import__\s*\(/
6 __build_class__.__self__.__getattribute__('__import__') /\b__import__\s*\(/
7 vars aliased to a variable, __builtins__ accessed via dict key /\bvars\s*\(/, /\b__builtins__\b/, /\b__import__\s*\(/

Repro

The proof of concept (poc.py) has three modes of operation:

mode = "server": Starts a malicious server that responds to "/api/chat" requests with a JSON object containing an LLM response with the selected attack payload.

mode = "chatflow": Authenticates to the Flowise server, creates a chatflow with a CSV Agent node configured to use a ChatOllama model pointed at the malicious server, and triggers a prediction to execute the payload.

mode = "prompt_injection": Sends a prompt injection payload directly to an existing chatflow's prediction endpoint. Due to the nature of LLM responses, it may take multiple attempts or require a different injection technique depending on the model used.

python3 poc.py --mode [server OR chatflow OR prompt_injection] [--user <USER> --passwd <PASSWORD> --host <HOST> --r_host <R_HOST> --r_port <R_PORT> --l_port <L_PORT> --port <PORT> --cmd <CMD> --attack <ATTACK> --chatflow_id <CHAT_ID>]

-- CREDIT --------------------------------------- This vulnerability was discovered by: Dre Cura (@dre_cura) of TrendAI Research

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm flowise < 3.1.3 3.1.3
Paczka npm flowise-components < 3.1.3 3.1.3

Odnośniki

Ocena CVSS -
Wektor CVSS
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
Słabość (CWE)
CWE-94
Platforma
npm
Paczka
flowise, flowise-components
Ujawniono
04.08.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-5xvg-pmgg-3mxr - CC BY 4.0

Historia podatności: flowise-components

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (31) w archiwum
Wszystkich wpisów
31
Pierwsza → ostatnia
04.2025 10.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 16
  • Wysoka 12
  • Średnia 3

Ujawnienia w latach

  1. 2025: 3
  2. 2026: 28
Istotność:
  1. Flowise: CSV Agent Prompt Injection Remote Code Execution Vulnerability ten wpis
    Krytyczna CVE-2026-70477 < 3.1.3 3.1.3
  2. Krytyczna CVE-2026-69259 < 3.1.3 3.1.3
  3. Krytyczna CVE-2026-69256 < 3.1.3 3.1.3
  4. Krytyczna CVE-2026-69253 < 3.1.3 3.1.3
  5. Krytyczna CVE-2026-69251 < 3.1.3 3.1.3
  6. Wysoka CVE-2026-56274 < 3.1.2 3.1.2
  7. Krytyczna · 9.8 CVE-2026-41264 < 3.1.0 3.1.0
  8. Wysoka CVE-2026-41274 < 3.1.0 3.1.0
  9. Wysoka · 7.1 CVE-2026-41271 < 3.1.0 3.1.0
  10. Wysoka · 7.1 CVE-2026-41272 < 3.1.0 3.1.0
  11. Wysoka · 7.7 CVE-2026-41268 < 3.1.0 3.1.0
  12. Krytyczna · 8.8 CVE-2026-41137 < 3.1.0 3.1.0
  13. Krytyczna · 9.9 CVE-2026-40933 < 3.1.0 3.1.0
  14. Wysoka · 7.7 ghsa-j44m-5v8f-gc9c < 3.0.8 3.0.8
  15. Krytyczna · 9.9 CVE-2025-61913 < 3.0.8 3.0.8
  16. Wysoka · 7.6 CVE-2025-29189 < 2.2.4 2.2.4

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.