Threat intelligence

FlowiseAI Custom MCP Node Remote Code Execution

by Security News

FlowiseAI Custom MCP Node Remote Code Execution (CVE-2025-59528)

Overview

SonicWall Capture Labs threat research team became aware of the threat CVE-2025-59528, assessed its impact, and developed mitigation measures for this vulnerability. CVE-2025-59528, also known as Flowise CustomMCP Code Injection, is a critical remote code execution vulnerability affecting FlowiseAI Flowise in versions >= 2.2.7-patch.1 and < 3.0.6. The vulnerability allows unauthenticated attackers to execute arbitrary JavaScript code on the server by injecting malicious payloads through the mcpServerConfig parameter of the CustomMCP node's API endpoint. Classified under CWE-94 (Improper Control of Generation of Code) and rated CVSS 10.0 (Critical), the flaw was discovered by Kim SooHyun (@im-soohyun) and reported via GitHub Security Advisory GHSA-3gcm-f6qx-ff7p. Active exploitation has been observed in the wild. This vulnerability is currently being tracked for inclusion in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score of 84.07% places this vulnerability in the 99.28th percentile for near-term exploitation probability. Affected products include FlowiseAI Flowise versions 2.2.7-patch.1 through 3.0.5. Fixes are available in version 3.0.6. Users should upgrade immediately.

Technical Overview

FlowiseAI Flowise is a popular open-source low-code platform for building AI agents and LLM-powered applications. The platform enables users to create custom tool integrations using Model Context Protocol (MCP) servers through the CustomMCP node component. This node accepts user-supplied configuration to connect to external MCP servers.

The root cause of CVE-2025-59528 lies in the convertToValidJSONString function within CustomMCP.ts (Lines 262-270). This function is responsible for converting user-provided MCP server configuration strings into valid JSON. However, instead of using a safe JSON parser, it passes the user input directly to JavaScript's Function() constructor — which is functionally identical to eval(). The expression Function('return ' + inputString)() compiles and executes the user-supplied string as arbitrary JavaScript code with full Node.js runtime privileges.

figure1.png
Figure 1: CVE-2025-59528 Exploitation Flow — Taint path

The vulnerable code path begins at the REST API route /api/v1/node-load-method/customMCP, which accepts POST requests containing an mcpServerConfig parameter. The request flows through the route handler, controller, and service layers without any input validation or sanitization before reaching the dangerous Function() call. At no point in this chain is the user input checked for malicious code patterns or restricted to safe data formats.

figure2.png
Figure 2: Vulnerable convertToValidJSONString function

The complete taint flow spans four source files across the Flowise codebase. User input enters via the route registration in node-load-methods/index.ts (Line 5), passes through the controller's getSingleNodeAsyncOptions handler (Lines 57-78), is forwarded by the service layer (Lines 91-94), reaches the CustomMCP node's listActions method (Line 132), undergoes template variable substitution without security filtering (Line 220), and finally reaches the vulnerable convertToValidJSONString function (Lines 262-270) where it is executed as code.

figure3.png
Figure 3: Complete taint flow from HTTP route registration

The security fix in version 3.0.6 replaces the dangerous Function() constructor with JSON5.parse(), a strict data format parser that only parses JSON-like data structures without executing any code. This single-line change eliminates the code injection vector entirely while preserving the intended functionality of converting relaxed JavaScript object notation to valid JSON.

figure4.png
Figure 4: Vulnerability reporter Kim SooHyun's profile and

Triggering the Vulnerability

The following conditions must be met for successful exploitation of CVE-2025-59528:

  • Vulnerable Flowise Version: The target must be running FlowiseAI Flowise version >= 2.2.7-patch.1 and < 3.0.6.
  • Network Access to API: The attacker must have network access to the Flowise API endpoint /api/v1/node-load-method/customMCP (typically on port 3000).
  • No Authentication Required: While Flowise supports optional API key authentication, the vulnerability can be exploited without credentials when authentication is not configured — a common deployment scenario. When authentication is enabled, a valid API token is sufficient.
  • CustomMCP Component Loaded: The Flowise instance must have the CustomMCP node component available in its component pool (included by default in standard installations).
  • POST Request Capability: The attacker must be able to send HTTP POST requests with a JSON body to the vulnerable endpoint.

Critical Note: This vulnerability requires no user interaction and can be exploited by any network-adjacent attacker. The attack complexity is low, making it trivially exploitable with a simple HTTP request. Because Flowise instances are commonly internet-facing as AI application backends, the attack surface is significant.

Exploitation

The exploitation of CVE-2025-59528 involves sending a crafted HTTP POST request to the Flowise API endpoint that processes CustomMCP node configurations. The payload leverages JavaScript's Function() constructor to achieve arbitrary code execution within the Node.js runtime environment.

Exploit Payload Structure

The attacker constructs a JSON request body containing a malicious mcpServerConfig value that, when passed to Function('return ' + inputString)(), evaluates as a JavaScript expression with embedded code execution. The payload uses an Immediately Invoked Function Expression (IIFE) wrapped in an object literal to satisfy the expected return type while executing arbitrary commands.

figure5.png
Figure 5: Exploit HTTP request targeting the CustomMCP
Payload Key Components
ComponentValuePurpose
Endpoint/api/v1/node-load-method/customMCPREST API route that triggers CustomMCP node methods
loadMethodlistActionsSpecifies the node method to invoke, reaching the vulnerable code path
mcpServerConfig({x:(function(){...})()})IIFE wrapper that executes injected JS and returns an object
process.mainModule.requirechild_processAccesses Node.js built-in module for OS command execution
execSync / execShell commandExecutes arbitrary operating system commands synchronously or asynchronously
Exploitation Demo
The following video demonstrates a live exploitation of CVE-2025-59528, showing the full attack chain from crafting the malicious HTTP request to achieving remote code execution on the Flowise server in under one minute.

Threat Intelligence

Active Exploitation Status

Given the critical severity (CVSS 10.0), trivial exploitation complexity, and the availability of public proof-of-concept code, CVE-2025-59528 represents a high-priority threat. The EPSS score of 84.07% (99.28th percentile) indicates an extremely high probability of exploitation in the near term. FlowiseAI Flowise is widely deployed as an AI/LLM application orchestration platform, with over 37,000 GitHub stars and significant adoption in enterprise environments.

Attack Surface Considerations
FactorAssessment
Public PoC AvailabilityYes — PoC published in GitHub Security Advisory
Authentication RequiredNo (optional API key only)
Attack ComplexityLow — single HTTP request
Network ExposureOften internet-facing as AI backend
EPSS Score84.07% (99.28th percentile)
Shodan/Censys IndexedFlowise instances discoverable via service fingerprinting
Observed Post-Exploitation Activity
ActivityDescription
ReconnaissanceExecution of id, whoami, hostname, uname -a to profile the target system
Credential HarvestingReading environment variables containing API keys, database passwords, and cloud credentials
Reverse Shell EstablishmentUsing netcat, bash TCP redirect, or Python socket for persistent access
Lateral MovementLeveraging stolen cloud credentials and API tokens to access connected services
Data ExfiltrationAccessing AI model configurations, training data, and conversation logs

SonicWall Protections

To ensure SonicWall customers are prepared for any exploitation that may occur due to this vulnerability, the following signatures have been released:

Signature IDSignature Name
IPS: 21519FlowiseAI Flowise CustomMCP Remote Code Execution 1
IPS: 21918FlowiseAI Flowise CustomMCP Remote Code Execution 2

Remediation Recommendations

The risks posed by CVE-2025-59528 can be mitigated or eliminated by:

  • Upgrade to Flowise 3.0.6 or Later: Apply the official security patch that replaces Function() with JSON5.parse() in the convertToValidJSONString function. This completely eliminates the code injection vector.
  • Enable API Authentication: Configure Flowise with a strong API key or bearer token authentication to restrict access to the API endpoints. While this does not fully mitigate the vulnerability, it adds a defense-in-depth layer.
  • Restrict Network Access: Ensure Flowise API endpoints are not directly exposed to the internet. Use a reverse proxy with WAF capabilities and restrict access to trusted IP ranges.
  • Monitor for Exploitation Attempts: Inspect HTTP logs for POST requests to /api/v1/node-load-method/customMCP containing JavaScript keywords such as process.mainModule, child_process, require, execSync, or Function.
  • Apply Network Segmentation: Isolate Flowise servers from sensitive internal resources. Implement strict egress filtering to detect and block unauthorized outbound connections (e.g., reverse shells).
  • Utilizing IPS signatures: Deploy updated IPS signatures to detect and block malicious payloads.
  • Network segmentation: Isolate application servers from sensitive internal resources and implement egress filtering to detect unauthorized outbound connections.

Relevant Links

Attribution

Vulnerability discovered and reported by Kim SooHyun (@im-soohyun) via GitHub Security Advisory.

Advisory published by HenryHengZJ (FlowiseAI maintainer) on September 13, 2025.

Share This Article

An Article By

Security News

The SonicWall Capture Labs Threat Research Team gathers, analyzes and vets cross-vector threat information from the SonicWall Capture Threat network, consisting of global devices and resources, including more than 1 million security sensors in nearly 200 countries and territories. The research team identifies, analyzes, and mitigates critical vulnerabilities and malware daily through in-depth research, which drives protection for all SonicWall customers. In addition to safeguarding networks globally, the research team supports the larger threat intelligence community by releasing weekly deep technical analyses of the most critical threats to small businesses, providing critical knowledge that defenders need to protect their networks.

Related Articles

  • MongoBleed MongoDB SBE Use-After-Free (CVE-2025-6706 / CVE-2025-14847)
    Read More
  • React2Shell (CVE-2025-55182) Critical Unauthenticated RCE
    Read More