Back to skill

Security audit

ComfyUI执行器

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent ComfyUI API helper, but unsafe file path and credential handling could let a malicious server or bad argument overwrite, read, or delete local files or expose an API key.

Review before installing. Use this only with ComfyUI servers you control, avoid sending API keys over non-local HTTP, and do not run workflow show/delete with untrusted names. The safest path is to patch filename/path validation, require confirmations for delete/history/interrupt actions, and stop printing API keys before using it on important workspaces.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/comfyui_executor.py:356
Finding

Server-Controlled Path Traversal Allows Arbitrary Local File Overwrite

Content
View full analysis
= 400: return None # 保存文件 output_file = output_path / filename with open(output_file, "wb") as f: f.write(response.content) ``` ### Technical Analysis The `filename` value is obtained from the ComfyUI server's execution-history response. The code joins this remotely controlled value directly to the user-selected output directory without validating whether it is an absolute path or contains traversal components such as `..`. Python's `pathlib` permits the resulting path to escape `output_path`. If `filename` is absolute, it can replace the preceding directory entirely. If it contains traversal sequences, the resolved destination can point outside the output directory. The use of `"wb"` also truncates and overwrites an existing destination file. The implementation performs no canonicalization, containment check, filename normalization, symlink defense, or overwrite confirmation. ### Attack Path 1. A user connects the Skill to a compromised or attacker-controlled ComfyUI server, including through the supported `--server-url` option. 2. The user submits a workflow and the client polls the server for execution history. 3. The malicious server returns an output entry such as: ```json { "images": [ { "filename": "../../.bashrc", "subfolder": "", "type": "output" } ] } ``` 4. The client requests the corresponding content from `/view`. 5. The client evaluates `output_path / "../../.bashrc"` without checking the resolved locatio ...[truncated 817 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/workflow_manager.py:143
Finding

Workflow Name Traversal Allows Arbitrary Local JSON File Disclosure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/workflow_manager.py:178
Finding

Workflow Name Traversal Allows Arbitrary Local File Deletion

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/config_loader.py:289
Finding

Insecure API-Key Handling Exposes Credentials Through Plaintext Transport and Diagnostic Output

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (38)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch includes undeclared local workflow deletion capability, while the stated purpose centers on remote HTTP interaction. Undocumented local file deletion is materially dangerous because it can destroy user assets or workflow definitions and is more sensitive than a read-only integration would suggest.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The POST /history endpoint supports clearing all history or deleting selected history entries, but the documentation does not warn that this removes execution records and may be irreversible. This is a direct user-data-impacting behavior that should be explicitly disclosed in markdown.

Content

No source excerpt is available for this finding.

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 · scripts/comfyui_executor.py (reported line 176)May include surrounding context.

python
if not prompt_id:
                raise Exception("未获取到 prompt_id")
            
            return prompt_id
            
        except requests.exceptions.RequestException as e:
            raise Exception(f"网络请求失败: {str(e)}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The README promotes file upload over HTTP API without any notice about data sensitivity, retention, transport security, or where uploaded files are stored. Because this skill can handle images, video, audio, and models, users may upload sensitive or proprietary content without understanding the privacy and exposure risks, especially when targeting non-local servers.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README advertises disruptive operations such as interrupting running tasks and clearing memory/history, but does not warn that these actions can terminate in-flight jobs, delete execution records, or affect other users sharing the ComfyUI instance. In a skill that exposes administrative actions over an HTTP API, missing safety guidance increases the chance of accidental denial of service or irreversible operational mistakes.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises network, file, and environment-related capabilities but does not declare any explicit tool scope such as permissions or allowed-tools. In an agent environment, this weakens least-privilege controls and can allow the skill to be invoked with broader access than users or reviewers expect.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

L003 将触发条件概括为“当用户需要使用 ComfyUI 生成图像、视频、音频或管理服务时使用”,覆盖面很广,但没有给出明确的触发短语、上下文限制或不应触发的反例。这类描述在清单/markdown 中容易让代理在较泛化的多媒体或服务管理请求下误调用该技能。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

该文件整体以中文编写,L003 的技能说明也默认以中文定义交互方式,但没有说明这是可选语言或仅适用于特定中文场景。若组织政策要求不强制特定语言/地区,缺少显式的用户语言选择可能构成自然语言层面的语言策略问题。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

L017 仅说明用户需要使用 ComfyUI 生成内容、管理队列、上传文件或探测能力时触发,但未列出排除条件或负面示例。对于技能路由来说,这种描述缺少触发范围约束,容易与一般性的文件上传、队列管理或媒体生成意图重叠。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The entire skill document is written as a Chinese-only specification (规范) and does not indicate any user language choice or justify a locale-specific scope. Per the policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file documents POST /queue with {"clear": true} to clear the queue, but it does not warn that this can remove pending tasks and affect user work. For markdown files, destructive behaviors that could affect user data or system integrity should include an explicit warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The POST /interrupt endpoint stops the currently running task, but the description lacks any caution that this may terminate in-progress work and produce partial or inconsistent outputs. The markdown should disclose this operational impact to users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file consistently presents all instructional content in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience. Per SQP-3, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

All natural-language strings in the module docstring and CLI help are Chinese, and the file does not offer any language selection or indicate that the tool is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains natural-language strings and documentation that force a specific language/locale for all users. Under the policy, language constraints should not be imposed unless the skill offers a choice or clearly documents a justified region-specific requirement.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

模块文档在 L007 声称优先级为“命令行参数 > 配置文件 > 环境变量 > 默认值”,而 get() 的实现与其 docstring 在 L122 也采用了这一顺序。这与常见“环境变量覆盖配置文件”的语义预期不同,但更关键的是该文档宣称支持此优先级时,代码确实如此实现,因此文件内部并不矛盾;不过若按“配置优先级”字面理解为环境变量应能覆盖文件配置,则这里存在意图表达误导。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The test entrypoint prints the API key directly to stdout, which can expose credentials in terminal history, logs, CI output, or shared debugging transcripts. In a tool that interacts with HTTP APIs, credential leakage can enable unauthorized use of the ComfyUI service or any upstream service protected by that key.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module docstring, CLI descriptions, help text, status output, and error messages are all written in Chinese, which imposes a specific language on users without opt-in. The file does not indicate that the tool is intentionally region-specific or provide any mechanism to select another language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The uploader is explicitly designed to transmit local files, and it also supports API-key-authenticated requests to a configurable remote server. That behavior is expected for this skill, but there is no explicit safety prompt, destination confirmation, or trust-boundary warning before local file contents and credentials are sent, which creates a real risk of unintended data disclosure if the server URL is misconfigured or attacker-controlled.

Content

No source excerpt is available for this finding.

Cloud Storage Exfiltration

Medium
Category
Data Exfiltration
Confidence
55% confidence
Finding

Data is uploaded to cloud storage (S3 / GCS / Azure Blob). This may be a legitimate backup or exfiltration to an external bucket. Manual review is recommended.

Content

Scanner excerpt · scripts/file_uploader.py (reported line 243)May include surrounding context.

python
Returns:
            上传结果
        """
        return self.upload_file(
            file_path=file_path,
            file_type='image',
            subfolder=subfolder,

Static analysis

No suspicious patterns detected.