Back to skill

Security audit

comfyui-running

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with ComfyUI image generation, but it uses high-impact local automation with weak scoping and consent controls.

Review before installing. Use this only if you are comfortable letting the skill start ComfyUI, install Python packages if dependencies are missing, control a Chrome/Edge debugging session, write generated images to your ComfyUI output folder, and potentially clear pending ComfyUI jobs. Prefer running it in an isolated environment, change ComfyUI startup to bind to 127.0.0.1, avoid sharing the ComfyUI queue with other users, and verify any browser debugging tab is only the intended ComfyUI page.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
lib/comfyui_automation.py:256
Finding

ComfyUI Service Is Exposed on All Network Interfaces Without Access Controls

Content
View full analysis
`. 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
View remediation

T08 · Insecure Dependencies

Warning
Location
lib/comfyui_automation.py:901
Finding

Unpinned Python Dependencies Are Installed Automatically at Runtime

Content
View full analysis
-q`. 4. Pip resolves an unspecified version from the active package index or mirror. 5. Downloaded package installation code executes with the permissions of the skill process. 6. A compromised index, malicious mirror, or compromised future release could execute unauthorized code. ### Impact Assessment Dependency installation runs with the current user's privileges and may modi ...[truncated 292 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
comfyui_browser.py:79
Finding

Caller-Supplied CDP Tab IDs Permit Control of Unrelated Browser Pages

Content
View full analysis
3 else None # sys.argv[3] = arg ws_url = get_ws_url(tab_id) try: ws = await ws_connect_with_retry(ws_url) async with ws: if real_action == "screenshot": path = real_arg or "/tmp/comfyui.png" ok = await screenshot(ws, path) print(f"{'OK' if ok else 'FAILED'}: {path}") elif real_action == "press_key": ok = await press_key(ws, real_arg or "Enter") print(f"Key sent: {real_arg}") elif real_action == "set_batch": count = int(real_arg) if real_arg else 2 ok, detail = await set_batch(ws, count) print(f"Batch {'OK' if ok else 'FAILED'}: {detail}") ``` ### Technical Analysis The script accepts an arbitrary Chrome DevTools Protocol page identifier and constructs a WebSocket URL without verifying that the target page belongs to the configured ComfyUI origin. Although `find_comfyui_tab()` searches for a ComfyUI page, the general command dispatcher does not require callers to use that result and does not repeat the origin check. CDP grants powerful access to the selected browser target. The implemented actions include screenshot capture, keyboard injection, mouse interaction, and fixed JavaScript execution. This crosses the legitimate privilege boundary of a ComfyUI automation skill because an unrelated page in the same debugging session may contain private or authenticated content. ### Attack Path 1. Chr ...[truncated 995 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
comfyui_browser.py:407
Finding

Workflow Execution Deletes All Pending ComfyUI Queue Entries

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
config.json:1
Finding

Commented Configuration Is Invalid JSON and Security-Relevant Settings Are Silently Ignored

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (40)

Tainted flow: 'url' from os.environ.get (line 461, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · lib/comfyui_config.py (reported line 462)May include surrounding context.

python
"""
    try:
        url = f"http://127.0.0.1:{port}/system_stats"
        r = requests.get(url, timeout=timeout)
        if r.status_code == 200:
            data = r.json()
            version = data.get("system", {}).get("comfyui_version", "")

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Claiming cross-platform REST workflow execution while actually probing local Windows/WSL/Linux installation paths and performing filesystem diagnostics creates a transparency and trust problem. In a skill ecosystem, hidden or under-declared host inspection can expose sensitive directory structure information and expands the attack surface beyond the user's expected workflow operation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Claiming cross-platform REST workflow execution while actually probing local Windows/WSL/Linux installation paths and performing filesystem diagnostics creates a transparency and trust problem. In a skill ecosystem, hidden or under-declared host inspection can expose sensitive directory structure information and expands the attack surface beyond the user's expected workflow operation.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · comfyui_browser.py (reported line 26)May include surrounding context.

python
import json, asyncio, websockets, base64, sys, urllib.request, os, time, random

# 清除所有代理环境变量
for k in list(os.environ.keys()):
    if 'proxy' in k.lower():
        del os.environ[k]

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 223)May include surrounding context.

python
import json, asyncio, websockets, base64, sys, urllib.request, os, time, random

# 清除所有代理环境变量
for k in list(os.environ.keys()):
    if 'proxy' in k.lower():
        del os.environ[k]

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · comfyui_browser.py (reported line 391)May include surrounding context.

python
# 深拷贝避免修改原数据
                            import copy
                            prompt_copy = copy.deepcopy(nodes)
                            return prompt_copy, history_id
    except Exception as e:
        print(f"Error getting history: {e}", file=sys.stderr)
    return None, None

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 309)May include surrounding context.

python
startupinfo=startupinfo,
                        stdout=subprocess.DEVNULL,
                        stderr=subprocess.DEVNULL,
                        env=os.environ.copy()
                    )
                except PermissionError:
                    # PermissionError: 尝试使用系统 Python

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 321)May include surrounding context.

python
startupinfo=startupinfo,
                        stdout=subprocess.DEVNULL,
                        stderr=subprocess.DEVNULL,
                        env=os.environ.copy()
                    )
                except PermissionError:
                    # PermissionError: 尝试使用系统 Python

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 333)May include surrounding context.

python
startupinfo=startupinfo,
                        stdout=subprocess.DEVNULL,
                        stderr=subprocess.DEVNULL,
                        env=os.environ.copy()
                    )
                except PermissionError:
                    # PermissionError: 尝试使用系统 Python

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Dynamic software installation via pip is an unjustified privileged action for this skill's primary function. Even if the package names are fixed, it permits unreviewed code retrieval and environment mutation at execution time, which is dangerous in agent contexts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented trigger phrase is a normal-language request ('帮我启动ComfyUI并生成一张猫咪图片') that overlaps with ordinary user intent, so the skill may activate in situations where the user did not explicitly consent to this specific automation package. In this skill’s context, activation can cascade into process launch, workflow execution, dependency installation, and file download, making broad triggering materially riskier than a benign informational skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation advertises automatic config generation, process startup, workflow execution, dependency installation, image download, and broad filesystem path scanning across multiple drives and mount points without a prominent warning or explicit consent boundary. In an agent skill, these behaviors meaningfully expand execution and privacy risk because a user may issue a simple generation request without realizing the skill will inspect many filesystem locations and modify the environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation describes capabilities that imply filesystem access, process launching, browser automation, and network communication, but the manifest does not declare any tool scope or permission boundaries. This is dangerous because consumers and execution frameworks cannot accurately constrain what the skill is allowed to do, increasing the risk of over-privileged execution and unintended local or network access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill executes workflows via REST API, but the documentation additionally states it controls an Edge browser through the CDP protocol. This inconsistency is dangerous because browser automation via CDP materially expands capability and risk, including automated interaction with local browser state, pages, and potentially authenticated sessions, without being clearly declared in the manifest.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The primary description and operational documentation are presented in Chinese, including workflow names and usage examples, with no indication that another language is supported or that the language requirement is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing natural-language instructions entirely in Chinese, including the top-level docstring and later CLI usage/help text. That imposes a specific language on users without offering a language/locale choice, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script iterates over all environment variables and deletes any whose name contains 'proxy', globally disabling proxy settings for all subsequent network activity in the process. That exceeds the stated purpose of running ComfyUI via local REST/CDP and can bypass enterprise monitoring, egress controls, and user-configured routing, making the skill materially more suspicious in context.

Content

No source excerpt is available for this finding.

Tainted flow: 'req' from urllib.request.urlopen (line 420, network input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · comfyui_browser.py (reported line 421)May include surrounding context.

python
try:
                    del_url = f"http://127.0.0.1:{COMFYUI_PORT}/queue/pending/{prompt_id}"
                    req = urllib.request.Request(del_url, method="DELETE")
                    urllib.request.urlopen(req, timeout=5)
                    print(f"Cleared stale queue entry: {prompt_id[:20]}")
                except:
                    pass

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 303)May include surrounding context.

python
startupinfo.wShowWindow = subprocess.SW_HIDE  # 隐藏窗口
                
                try:
                    self.process = subprocess.Popen(
                        cmd,
                        cwd=self.comfyui_root,
                        startupinfo=startupinfo,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 315)May include surrounding context.

python
startupinfo.wShowWindow = subprocess.SW_HIDE  # 隐藏窗口
                
                try:
                    self.process = subprocess.Popen(
                        cmd,
                        cwd=self.comfyui_root,
                        startupinfo=startupinfo,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 327)May include surrounding context.

python
elif system in ("linux", "wsl", "darwin"):
                # ========== Linux/macOS 启动 ==========
                # start_new_session: 创建独立会话,关闭终端后进程继续运行
                self.process = subprocess.Popen(
                    cmd,
                    cwd=self.comfyui_root,
                    stdout=subprocess.DEVNULL,

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 644)May include surrounding context.

python
}
        
        try:
            r = requests.post(f"{self.base_url}/prompt", json=data, timeout=10)
            if r.status_code == 200:
                return r.json().get("prompt_id")
            else:

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description suggests workflow execution via local REST API, but the file also silently installs Python packages at runtime. This expands the skill's capability beyond its declared purpose and increases host modification and supply-chain exposure without clear user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The package installation occurs automatically and without any explicit confirmation flow. This violates least surprise, can alter the user's environment, and may trigger network access or policy violations unexpectedly.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The code automatically invokes pip at runtime to install packages without user confirmation. This executes a package manager operation in the local environment, can modify the host unexpectedly, and creates supply-chain risk if package resolution is tampered with or a malicious mirror/index is used.

Content

Scanner excerpt · lib/comfyui_automation.py (reported line 906)May include surrounding context.

python
importlib.import_module(mod_name)
        except ImportError:
            print(f"[INFO] Installing dependency: {pkg}")
            subprocess.check_call([sys.executable, "-m", "pip", "install", pkg, "-q"])


def quick_generate(prompt: str, **kwargs) -> Dict: