T09 · Insecure Skill Coding Practices
- 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
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/generate.py:14Arbitrary ComfyUI endpoint allows SSRF and disclosure of prompts and input images
scripts/generate.py:75Unvalidated API response paths permit local file disclosure and output path traversal
README.md:19Installation guidance relies on mutable and unverified dependencies and model artifacts
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
def check_server(url=COMFYUI_URL):
try:
urllib.request.urlopen(f"{url}/system_stats", timeout=5)
return True
except Exception:
return False
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
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", {})
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
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
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.
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.
cd ~/ComfyUI
# 创建目录
mkdir -p models/unet models/vae models/clip
# 下载 Flux1-schnell(使用 ModelScope Python API)
python3 -c "
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.
cd ~/ComfyUI
# 创建目录
mkdir -p models/unet models/vae models/clip
# 下载 Flux1-schnell(使用 ModelScope Python API)
python3 -c "
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.
EOF
systemctl --user daemon-reload systemctl --user enable --now comfyui.service
---
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
curl -X POST http://127.0.0.1:8188/prompt \
-H "Content-Type: application/json" \
-d '{"prompt": {... Flux workflow ...}}'
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.
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.
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.
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.