ComfyUI is a professional graphical interface for Stable Diffusion based on node-based workflows. ComfyUI-Manager is its official extension manager. This skill covers two CVEs, both of which ultimately achieve RCE by installing a malicious custom node.
- Product:ComfyUI + ComfyUI-Manager | Default Port:8188
- Tech Stack: Python backend, aiohttp, Git custom node distribution
- Startup Method:
python main.py --listen(requires--listenfor remote access)
Vulnerability Overview
| CVE | Type | Authentication | Impact | Affected Versions |
|---|---|---|---|---|
| CVE-2025-67303 | Unauthorized read/write of configuration files | None | RCE | < v3.38 |
| CVE-2026-22777 | CRLF injection downgrading the security level | None | RCE | < v3.39.2, 4.0.0~4.0.4 |
The final exploitation stage of both CVEs is exactly the same—installing a malicious custom node to execute arbitrary code. The difference lies in how to bypass security_level。
Attack Decision Tree
已识别目标为 ComfyUI?
├── Manager 版本 < v3.38?
│ └── CVE-2025-67303:直接读写 config.ini → 详见 references/cve-exploit-details.md
├── Manager 版本 v3.38 ~ v3.39.1 或 4.0.0~4.0.4?
│ └── CVE-2026-22777:CRLF 注入降级 → 详见 references/cve-exploit-details.md
├── 不确定版本?
│ ├── 先尝试 CVE-2025-67303(GET /userdata/...)
│ ├── 返回 404 则尝试 CVE-2026-22777
│ └── 两者都利用降级后安装恶意节点
└── security_level 已经是 weak?
└── 直接安装恶意节点 → 详见 references/malicious-node-payloads.md
Exploitation Stage Overview
- Stage One: Downgrade
config.iniinsecurity_leveltoweak(the two CVEs use different methods) - Stage Two: Call
/api/manager/rebootto restart the service so the configuration takes effect - Stage Three: Start a malicious Git server and install the malicious node via
/customnode/install/git_urlInstall malicious node
Key API Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/userdata/ComfyUI-Manager%2Fconfig.ini |
GET/POST | CVE-2025-67303: Read/write configuration files |
/api/manager/db_mode?value=... |
GET | CVE-2026-22777: CRLF injection to write configuration |
/api/manager/reboot |
POST | Restart the service so the configuration takes effect |
/customnode/install/git_url |
POST | Install a custom node (triggers malicious code) |
Detection and Defense
- Monitor
/userdata/ComfyUI-Manager%2Fconfig.inifor abnormal read/write,db_modein the parameters%0D/%0A - Monitor
config.iniinsecurity_levelbeing modified toweak, installing nodes from suspicious URLs - Remediation: Upgrade to v3.39.2+ or v4.0.5+, avoid exposing
--listento the public internet