ComfyUI-Manager 远程代码执行漏洞(CVE-2026-22777)

环境搭建:

下载 ComfyUI_windows_portable_nvidia.7z 版本

参考:https://github.com/Comfy-Org/ComfyUI-Manager

上述运行完后,在 \ComfyUI\custom_nodes\comfyui-manager\ 中使用 git 切换 3.37 漏洞版本

git checkout 3.37

编辑 run_cpu.bat 文件,添加 –listen 后双击启动

漏洞分析:

read_config() 读取配置使用了 strict=False,导致重复的后面的值会覆盖前面的值

查看 config.ini 文件,只能通过 /manager/de_mode 接口来利用

漏洞复现:

修改 config.ini 中参数security_level = weak


重启后生效

1
2
3
4
5
6
GET /api/manager/reboot HTTP/1.1
Host: 127.0.0.1:8188
Comfy-User:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.57 Safari/537.36
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

下载恶意代码库并重启