CVE-2026-70477: Flowise Remote Code Execution Vulnerability
CRITICALCVE-2026-70477 is a CRITICAL remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Flowise libraries in the npm ecosystem. The issue involves csv agent prompt injection remote code execution vulnerability. Remediation is available by upgrading affected packages to version 3.1.3.
CVE-2026-70477 at a Glance
How to Fix CVE-2026-70477
To remediate this vulnerability, upgrade all affected Flowise dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install flowise@3.1.3
npm install flowise-components@3.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls flowise
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-70477, inspect your project dependencies using npm:
npm ls flowise
Analyze the terminal output to locate any version of Flowise in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.3), your application is affected.
Note: The npm ls flowise command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Flowise, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-70477 Affected Flowise Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
flowise
|
npm |
< 3.1.3
|
3.1.3
|
|
flowise-components
|
npm |
< 3.1.3
|
3.1.3
|
References
Frequently Asked Questions
What is CVE-2026-70477?
Which Flowise versions are affected?
What version fixes CVE-2026-70477?
Is flowise affected?
Is flowise-components affected?
What CWE is associated with CVE-2026-70477?
How can I check npm dependencies for CVE-2026-70477?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5xvg-pmgg-3mxr",
"modified" : "2026-08-04T19:29:26Z",
"published" : "2026-08-04T19:29:26Z",
"aliases" : [ "CVE-2026-70477" ],
"summary" : "Flowise: CSV Agent Prompt Injection Remote Code Execution Vulnerability",
"details" : "-- ABSTRACT -------------------------------------\n\nTrend Micro's Zero Day Initiative has identified a vulnerability affecting the following products:\nFlowise - Flowise\n\n-- VULNERABILITY DETAILS ------------------------\n* Version tested: 3.1.1\n* Installer file: https://github.com/FlowiseAI/Flowise (npm install flowise@3.1.1)\n* Platform tested: Ubuntu 25.10\n\n---\n\nA 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.\n\n```\nThis vulnerability allows remote attackers to execute arbitrary code on affected installations of Flowise. Authentication is not required to exploit this vulnerability.\n\nThe 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.\n```\n\n### Analysis\n\nWhen 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.\n\nThe 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.\n\nFrom `packages/components/nodes/agents/CSVAgent/CSVAgent.ts`:\n```ts\nlet pythonCode = ''\nif (dataframeColDict) {\n const chain = new LLMChain({\n llm: model,\n prompt: PromptTemplate.fromTemplate(systemPrompt),\n verbose: process.env.DEBUG === 'true' ? true : false\n })\n const inputs = {\n dict: dataframeColDict,\n question: input // user-controlled input substituted into prompt\n }\n const res = await chain.call(inputs, [loggerHandler, ...callbacks])\n pythonCode = res?.text // LLM response assigned to pythonCode\n pythonCode = pythonCode.replace(/^```[a-z]+\\n|\\n```$/gm, '')\n}\n\nlet finalResult = ''\nif (pythonCode) {\n const validation = validatePythonCodeForDataFrame(pythonCode) // blocklist validation applied\n if (!validation.valid) {\n throw new Error(\n `Generated code was rejected for security reasons (${\n validation.reason ?? 'unsafe construct'\n }). Please rephrase your question to use only pandas DataFrame operations.`\n )\n }\n try {\n const code = `import pandas as pd\\nimport numpy as np\\n${pythonCode}`\n finalResult = await pyodide.runPythonAsync(code) // executed in unsandboxed pyodide\n } catch (error) {\n throw new Error(`Sorry, I'm unable to find answer for question: \"${input}\" using following code: \"${pythonCode}\"`)\n }\n}\n```\n\nAn 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.\n\nEight bypass variants were demonstrated against the validator:\n\n| Variant | Technique | Bypasses |\n|---------|-----------|----------|\n| 0 | `@exec` decorator with string-concatenated `__import__` | `/\\bexec\\s*\\(/`, `/\\b__import__\\s*\\(/` |\n| 1 | `eval` aliased to a variable, payload chr()-encoded | `/\\beval\\s*\\(/`, `/\\bimport\\b/` |\n| 2 | `df.query()` with chr()-encoded `@__builtins__.__import__` | `/\\b__builtins__\\b/`, `/\\b__import__\\s*\\(/` |\n| 3 | MRO traversal + `__getattribute__` + `__subclasses__` -> `BuiltinImporter.load_module` | `/\\b__class__\\b/`, `/\\b__subclasses__\\s*\\(/`, `/\\b__mro__\\b/` |\n| 4 | Generator frame inspection via `gi_frame.f_globals['__loader__']` | `/\\b__loader__\\b/`, `/\\b__globals__\\b/` |\n| 5 | Exception traceback frame walk to `f_builtins['__import__']` | `/\\b__globals__\\b/`, `/\\b__import__\\s*\\(/` |\n| 6 | `__build_class__.__self__.__getattribute__('__import__')` | `/\\b__import__\\s*\\(/` |\n| 7 | `vars` aliased to a variable, `__builtins__` accessed via dict key | `/\\bvars\\s*\\(/`, `/\\b__builtins__\\b/`, `/\\b__import__\\s*\\(/` |\n\n### Repro\n\nThe proof of concept (`poc.py`) has three modes of operation:\n\n**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.\n\n**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.\n\n**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.\n\n```\npython3 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>]\n```\n\n\n-- CREDIT ---------------------------------------\nThis vulnerability was discovered by:\nDre Cura (@dre_cura) of TrendAI Research",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "flowise"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.1.2"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "flowise-components"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.1.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-5xvg-pmgg-3mxr"
}, {
"type" : "WEB",
"url" : "https://github.com/FlowiseAI/Flowise/pull/6499"
}, {
"type" : "WEB",
"url" : "https://github.com/FlowiseAI/Flowise/commit/f4e2794f6a576b94578f2fdafbf49c2fb304626c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/FlowiseAI/Flowise"
}, {
"type" : "WEB",
"url" : "https://github.com/FlowiseAI/Flowise/releases/tag/flowise@3.1.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-04T19:29:26Z",
"nvd_published_at" : null
}
}