T09 · Insecure Skill Coding Practices
Error
- Location
- lib/comfyui_automation.py:256
- Finding
- ComfyUI Service Is Exposed on All Network Interfaces Without Access Controls<![CDATA[ ## Vulnerability Details **File Location**: `lib/comfyui_automation.py`, lines 256-260 **Vulnerability Type**: Unnecessary network exposure and missing access controls **Risk Level**: High ### Vulnerable Code ```python cmd = [ python_exe, main_py, "--listen", "0.0.0.0", "--port", str(self.port) ] ``` ### Technical Analysis The automation launches ComfyUI with `--listen 0.0.0.0`, which binds the service to every available network interface. This is unnecessary because the skill's own API operations use `http://127.0.0.1:<port>`. The skill does not add authentication, authorization, transport encryption, or source-address restrictions. The actual exposure also depends on the host firewall and ComfyUI configuration, but the launch command makes remote access possible by default. ComfyUI installations can include custom nodes with extensive filesystem, network, model-loading, or command-execution capabilities. Exposing such an instance increases the consequences of any weakness in ComfyUI or an installed custom node. ### Attack Path 1. A user invokes image generation while ComfyUI is not already running. 2. `ensure_comfyui_running()` calls `start_comfyui()`. 3. `_build_start_command()` adds `--listen 0.0.0.0`. 4. ComfyUI begins listening on every network interface at the configured port. 5. A host with network access connects to the exposed ComfyUI API. 6. The remote host may inspect API data, submit workflows, consume system resources, or reach capabilities exposed by installed custom nodes. ### Impact Assessment An attacker able to reach the port may obtain unauthorized access to the ComfyUI API and its workflow-processing capabilities. Potential effects include disclosure of workflow history, unauthorized generation jobs, GPU or CPU resource exhaustion, access to generated content, and abuse of installed custom nodes. The scope is the ComfyUI process and any files, devices, network resources, or custom-node capabilities access ...[truncated 44 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Bind to `127.0.0.1` by default: ```python cmd = [ python_exe, main_py, "--listen", "127.0.0.1", "--port", str(self.port) ] ``` - Require an explicit configuration option and prominent confirmation before enabling remote access. - If remote access is necessary, place ComfyUI behind an authenticated reverse proxy with TLS. - Restrict inbound access using host and network firewalls. - Run ComfyUI under a dedicated, least-privileged operating-system account. - Audit installed custom nodes before allowing any remote connectivity. ]]>
