SuperAPI AI Directory

comfyui-exploit

Security & auditing

View repository

Updated 10-16 09:15

About this skill

ComfyUI-Manager Exploit Skill

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 --listen for 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

  1. Stage One: Downgrade config.ini in security_level to weak(the two CVEs use different methods)
  2. Stage Two: Call /api/manager/reboot to restart the service so the configuration takes effect
  3. Stage Three: Start a malicious Git server and install the malicious node via /customnode/install/git_url Install 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.ini for abnormal read/write,db_mode in the parameters %0D/%0A
  • Monitor config.ini in security_level being modified to weak, installing nodes from suspicious URLs
  • Remediation: Upgrade to v3.39.2+ or v4.0.5+, avoid exposing --listen to the public internet

Detailed Reference