Miggo Logo

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

10

CVSS Score
3.1

Basic Information

EPSS Score
-
Published
9/15/2025
Updated
9/22/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
flowisenpm= 3.0.53.0.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists in the CustomMCP component of Flowise, where user-provided configuration for an MCP server is parsed insecurely. The root cause is the convertToValidJSONString function in packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts. This function used the Function() constructor to parse the mcpServerConfig string, which is a known security risk as it executes the string as JavaScript code. An attacker can provide a malicious JavaScript payload in the mcpServerConfig parameter, which will then be executed by the Node.js runtime with the server's privileges. This allows for a full remote code execution (RCE) vulnerability.

The patch, identified in commit 4af067a444a579f260d99e8c8eb0ae3d5d9b811a, replaces the insecure Function('return ' + inputString)() call with JSON5.parse(inputString). This change ensures that the input is treated as data (JSON) and not as executable code, effectively mitigating the RCE vulnerability.

The analysis identified two key functions:

  1. convertToValidJSONString: This is the function with the core vulnerability, where the code injection occurs.
  2. CustomMCP.loadMethods: This is the function that receives the tainted input from the user and passes it to the vulnerable function, making it a critical part of the exploit chain and a key indicator in a runtime profile.

Vulnerable functions

convertToValidJSONString
packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts
The function `convertToValidJSONString` is vulnerable because it uses the `Function()` constructor to evaluate a user-provided string (`inputString`). This allows an attacker to inject and execute arbitrary JavaScript code on the server, leading to remote code execution. The patch replaces the dangerous `Function()` constructor with the safer `JSON5.parse()` method.
CustomMCP.loadMethods
packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts
This method is the entry point for the vulnerability within the `CustomMCP` node. It retrieves the user-controlled `mcpServerConfig` input and passes it to the `convertToValidJSONString` function, which then executes it as code. Any exploit targeting this vulnerability will have `CustomMCP.loadMethods` in its call stack, as it's responsible for processing the malicious payload.

WAF Protection Rules

WAF Rule

## **s*ription ### **us* o* t** Vuln*r**ility T** `*ustomM*P` no** *llows us*rs to input *on*i*ur*tion s*ttin*s *or *onn**tin* to *n *xt*rn*l M*P (Mo**l *ont*xt Proto*ol) s*rv*r. T*is no** p*rs*s t** us*r-provi*** `m*pS*rv*r*on*i*` strin* to *uil*

Reasoning

T** vuln*r**ility *xists in t** `*ustomM*P` *ompon*nt o* *lowis*, w**r* us*r-provi*** *on*i*ur*tion *or *n M*P s*rv*r is p*rs** ins**ur*ly. T** root **us* is t** `*onv*rtToV*li*JSONStrin*` *un*tion in `p**k***s/*ompon*nts/no**s/tools/M*P/*ustomM*P/*u
CVE-2025-59528: Flowise CustomMCP Config RCE | Miggo