Back to skill

Security audit

ComfyUI Image & Video Generation

Security checks for vulnerabilities and agentic risk

Overview

The skill’s local ComfyUI purpose is coherent, but its script allows under-disclosed remote endpoints and unsafe file path handling that could expose prompts, input images, or readable local files if the endpoint is malicious or misconfigured.

Review this skill before installing. Use it only with a trusted local ComfyUI server, avoid setting COMFYUI_URL or --url to remote hosts, do not process sensitive source images unless you accept that they may be copied into ~/ComfyUI/input, and be cautious with output paths until filename containment checks are added. For installation, prefer pinned commits, verified model checksums, and an unprivileged account.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate.py:14
Finding

Arbitrary ComfyUI endpoint allows SSRF and disclosure of prompts and input images

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate.py:75
Finding

Unvalidated API response paths permit local file disclosure and output path traversal

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:19
Finding

Installation guidance relies on mutable and unverified dependencies and model artifacts

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
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tainted flow: 'url' from os.environ.get (line 299, credential/environment) → urllib.request.urlopen (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 · scripts/generate.py (reported line 48)May include surrounding context.

python
def check_server(url=COMFYUI_URL):
    try:
        urllib.request.urlopen(f"{url}/system_stats", timeout=5)
        return True
    except Exception:
        return False

Tainted flow: 'url' from os.environ.get (line 299, credential/environment) → urllib.request.urlopen (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 · scripts/generate.py (reported line 67)May include surrounding context.

python
while time.time() - start < timeout:
        time.sleep(2)
        try:
            resp = urllib.request.urlopen(f"{url}/history/{prompt_id}", timeout=10)
            hist = json.loads(resp.read())
            if prompt_id in hist:
                status = hist[prompt_id].get("status", {})

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 101)May include surrounding context.

md
systemctl --user status comfyui.service

# Check API
curl -s http://127.0.0.1:8188/system_stats | python3 -m json.tool

# Manual start (if systemd not available)
cd ~/ComfyUI && LD_LIBRARY_PATH=~/comfyui-venv/lib/python3.12/site-packages/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH ~/comfyui-venv/bin/python main.py --listen 127.0.0.1 --port 8188

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README forces a specific language for all instructions and operational guidance, which can violate language/locale policy when no user opt-in or alternative is provided. There is no indication that the skill is intentionally limited to a Chinese-only audience or region-specific compliance context.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 55)May include surrounding context.

md
cd ~/ComfyUI

# 创建目录
mkdir -p models/unet models/vae models/clip

# 下载 Flux1-schnell(使用 ModelScope Python API)
python3 -c "

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 55)May include surrounding context.

md
cd ~/ComfyUI

# 创建目录
mkdir -p models/unet models/vae models/clip

# 下载 Flux1-schnell(使用 ModelScope Python API)
python3 -c "

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 103)May include surrounding context.

EOF

systemctl --user daemon-reload systemctl --user enable --now comfyui.service

text

---

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · README.md (reported line 111)May include surrounding context.

5. 测试文生图

bash
curl -X POST http://127.0.0.1:8188/prompt \
  -H "Content-Type: application/json" \
  -d '{"prompt": {... Flux workflow ...}}'

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents capabilities to read environment state, write output files, and interact with a local HTTP API, but it declares no explicit tool scope or permissions boundary. That mismatch can cause an agent platform to grant broader-than-expected capabilities or leave reviewers unaware of the real attack surface, increasing the risk of unintended file writes or service interaction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

In image-to-video mode, the script silently copies the supplied image into ~/ComfyUI/input before processing. This creates an unexpected persistence/privacy issue because user-provided local images are duplicated into another directory without explicit notice, potentially exposing sensitive files to other local users, later workflows, or accidental retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script uploads the user-specified image to the configured ComfyUI API endpoint over plain HTTP by default and without an explicit user-facing warning. In the default localhost case this is lower risk, but if COMFYUI_URL or --url points to a remote host, sensitive local images may be transmitted off-machine without clear consent or transport protection.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, and there is no indication that the skill is region-specific or that users may opt into another language. Under the language/locale policy rule, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.