AgentbeamBeta
AI agent vulnerability · Flowise

CVE-2025-59528: Flowise has Remote Code Execution vulnerability

criticalCVSS 3.1 10.0GHSA-3gcm-f6qx-ff7p

Flowise 3.0.5 passes the CustomMCP node's mcpServerConfig string to the Function() constructor, so anyone who can call /api/v1/node-load-method/customMCP can run JavaScript on the server. That means command execution and file access. The advisory scores it 10.0. The package data lists 3.0.6 as the patched version.

Published Sep 15, 2025 · Updated Sep 22, 2025 · Analysis Nov 9, 2026

What an attacker can do

The CustomMCP node lets users enter the configuration for an external MCP server as text. The request reaches the node through POST /api/v1/node-load-method/customMCP with an mcpServerConfig input. The function convertToValidJSONString in CustomMCP.ts then evaluates the string with Function('return ' + inputString)(). Variable substitution for $vars templates happens first and applies no filtering.

Code evaluated this way runs in the Node.js context with access to child_process and fs. The reporter's proof of concept sends a JSON body whose mcpServerConfig holds an immediately-invoked function that calls execSync and writes /tmp/RCE.txt. The request carries only an Authorization bearer API token, with no admin session or user interaction. The CVSS vector shows no privileges required and a changed scope, which gives the 10.0.

An attacker with any valid API token for the instance, or an instance that is open without auth, gets full control of the host: shell commands, files, environment secrets and data from every connected flow. The EPSS score for this advisory is very high (about 0.86), which points to strong attacker interest. No source we read confirms exploitation.

Who is affected

The flowise npm package at 3.0.5, per the package data. Any instance that exposes the Flowise API to users or networks you do not fully trust is in scope. Check the version:

npm ls flowise

For Docker, check the image tag. Look at who holds API keys for the instance, and whether the Flowise port is open to the internet.

flowise

Ecosystem
npm
Affected
= 3.0.5
Fixed in
3.0.6
Check
npm ls flowise

How to fix it

Upgrade to flowise 3.0.6 or newer:

npm install -g flowise@latest

The package data names 3.0.6 as the patched version. The 3.0.6 release notes do not describe this fix; they list other security changes such as secured password reset endpoints and a chatId path traversal check. The sources give no workaround. Until you upgrade, keep Flowise off the public internet, restrict who holds API keys, and rotate all keys and secrets the server process can read if the instance was reachable.

How to tell if you were hit

Search web server and application logs for POST requests to /api/v1/node-load-method/customMCP, and read the body for mcpServerConfig values that contain process.mainModule, require, child_process, execSync or fs calls. On the host, look for child processes of the Flowise node process, unexpected files such as /tmp/RCE.txt, and outbound connections to unfamiliar hosts. Review which API tokens made the calls.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Description

Cause of the Vulnerability

The CustomMCP node allows users to input configuration settings for connecting to an external MCP (Model Context Protocol) server. This node parses the user-provided mcpServerConfig string to build the MCP server configuration. However, during this process, it executes JavaScript code without any security validation.

Specifically, inside the convertToValidJSONString function, user input is directly passed to the Function() constructor, which evaluates and executes the input as JavaScript code. Since this runs with full Node.js runtime privileges, it can access dangerous modules such as child_process and fs.

Vulnerability Flow

  1. User Input Received: Input is provided via the API endpoint /api/v1/node-load-method/customMCP through the mcpServerConfig parameter.
  2. Variable Substitution: The substituteVariablesInString function replaces template variables like $vars.xxx, but no security filtering is applied during this step.
  3. Dangerous Code Execution: The convertToValidJSONString function executes the input using Function('return ' + inputString)(). If the inputString contains malicious code, it gets executed in the global Node.js context, allowing actions such as command execution and file system access.

Taint Flow

Proof of Concept (PoC)

curl -X POST http://localhost:3000/api/v1/node-load-method/customMCP \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer tmY1fIjgqZ6-nWUuZ9G7VzDtlsOiSZlDZjFSxZrDd0Q" \
  -d '{
    "loadMethod": "listActions",
    "inputs": {
      "mcpServerConfig": "({x:(function(){const cp = process.mainModule.require(\"child_process\");cp.execSync(\"echo !!RCE-OK!! >/tmp/RCE.txt\");return 1;})()})"
    }
  }'

When executed, this creates a file /tmp/RCE.txt on the server, confirming command execution.

Impact

Complete System Takeover and Infrastructure Threat

This vulnerability allows attackers to execute arbitrary JavaScript code on the Flowise server, leading to:

  • Full system compromise
  • File system access
  • Command execution
  • Sensitive data exfiltration

As only an API token is required, this poses an extreme security risk to business continuity and customer data.

Credited to im-soohyun.

Questions

Does CVE-2025-59528 need a login?

The proof of concept uses a bearer API token. The advisory says only an API token is required, so any holder of a valid key can attack the instance.

Which Flowise version is fixed?

3.0.6, per the package data. The release notes of 3.0.6 do not mention the CustomMCP change, so confirm the code after upgrading.

Is it exploited in the wild?

It is not in CISA's KEV catalog and no source we read reports attacks, but the EPSS score is very high and a working proof of concept is public.

What does the attacker get?

Arbitrary JavaScript in the server's Node.js context, which gives command execution, file access and any secret the process can read.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Flowise vulnerabilities

All Flowise entries