Back to skill

Security audit

Coze Image

Security checks for vulnerabilities and agentic risk

Overview

This image-generation skill is mostly purpose-aligned, but it asks users to place an API token in source code and can download unvalidated remote content to user-chosen paths.

Review before installing. Use a virtual environment, avoid putting real API tokens in source files, prefer environment variables or a secret store, and do not include sensitive data in prompts sent to Coze. Be cautious with the -o save option because the tool downloads a remote URL without validation and writes it to the chosen path.

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

Warning
Location
coze_image.py:13
Finding

API Token Stored Directly in Tracked Source Code

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
coze_image.py:64
Finding

Unrestricted Retrieval of a Server-Provided Image URL

Content
View full analysis
Remediation
View remediation
MAX_IMAGE_BYTES: raise ValueError("Image exceeds the permitted size") output.write(chunk) ``` - Check `Content-Type` against a narrow image allowlist and verify the file signature using a trusted image parser before accepting the download. - Write initially to a safely created temporary file, validate it, and then atomically move it to the requested destination. ]]>

T08 · Insecure Dependencies

Note
Location
README.md:5
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The documented behavior says the skill generates images via Coze, but the analyzed behavior reportedly also includes downloading remote images to the local filesystem and an undeclared xhs-specific generation mode. Undeclared capabilities are dangerous because users and policy engines cannot accurately assess what the skill will do, increasing the risk of silent data handling, persistence, or misuse beyond the stated purpose.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The documented design relies on transmitting prompts to an external API endpoint, which is expected functionality for this image-generation skill but still constitutes a real data egress path. Because the skill is specifically triggered by user requests to generate images, the context makes this transmission inherent to operation, but it remains risky if users are not warned that sensitive prompt content leaves the local environment.

Content

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

CONFIG = { "api_token": "YOUR_COZE_API_TOKEN", # 你的 Coze API Token "workflow_id": "YOUR_WORKFLOW_ID", # 图片生成工作流 ID "api_url": "https://api.coze.cn/v1/workflow/run" }

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README instructs users to send prompts and authentication material to a third-party Coze API but does not warn that user input will be transmitted off-platform. In a skill that triggers on image-generation requests, prompts may contain sensitive business or personal data, so the lack of disclosure and handling guidance creates a real privacy and compliance risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill declares network-capable behavior but does not define any explicit tool scope, permissions, or allowed-tools boundaries. In an agent setting, this makes the operational surface ambiguous and can allow unintended outbound requests or future capability creep without clear policy constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs sending user-provided prompts to an external Coze API but does not explicitly warn the user that their input will leave the local environment. This creates a privacy and compliance risk because users may include sensitive, personal, or proprietary content in prompts without informed consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Broad trigger phrases like '生成图片' or 'AI画图' are underspecified and may cause the skill to activate in contexts the user did not intend, especially in multi-tool agent environments. Unintended invocation can lead to accidental external data transmission, API usage, or execution of side effects without sufficiently specific user confirmation.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 32)May include surrounding context.

md
BACKGROUND_IMAGE_URL = "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/96fb6aada1a947419ffee9fe8eaee153.png~tplv-mdko3gqilj-image.image"

# API 地址(通常不需要修改)
API_URL = "https://api.coze.cn/v1/workflow/run"
# ==================================================

CONFIG = {

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 · coze_image.py (reported line 24)May include surrounding context.

python
BACKGROUND_IMAGE_URL = "https://p9-bot-workflow-sign.byteimg.com/tos-cn-i-mdko3gqilj/96fb6aada1a947419ffee9fe8eaee153.png~tplv-mdko3gqilj-image.image"

# API 地址(通常不需要修改)
API_URL = "https://api.coze.cn/v1/workflow/run"
# ==================================================

CONFIG = {

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 · coze_image.py (reported line 50)May include surrounding context.

python
print(f"Prompt: {prompt[:50]}...")
    
    try:
        response = requests.post(
            CONFIG["api_url"],
            headers=headers,
            json=payload,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Although described as a text-to-image generator, the code also writes downloaded content to any caller-supplied save_path. This expands capability to arbitrary file write within the agent's permissions, which can overwrite user files or place untrusted content in sensitive locations if the path is attacker-influenced.

Content

No source excerpt is available for this finding.

Tainted flow: 'image_url' from requests.post (line 70, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
93% confidence
Finding

The tool takes an image URL returned by a remote API and immediately fetches it again with requests.get, following redirects, without validating the hostname, scheme, or content type. That creates an SSRF-style primitive and allows the remote service controlling the response to make the agent connect to unexpected endpoints and download attacker-chosen content before writing it locally.

Content

Scanner excerpt · coze_image.py (reported line 82)May include surrounding context.

python
print(f"Downloading to: {save_path}")
            # Handle redirect URLs
            try:
                img_response = requests.get(image_url, timeout=60, allow_redirects=True)
                if img_response.status_code == 200:
                    os.makedirs(os.path.dirname(save_path) or ".", exist_ok=True)
                    with open(save_path, "wb") as f:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt template explicitly instructs the model to add Chinese text ('添加文字,顶部居中用紫色字体显示标题...中间添加功能点...') regardless of user preference. This is a language-policy issue because the skill enforces a specific locale rather than offering a choice or documenting a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file's natural-language instructions are presented only in Chinese, which can amount to a language/locale policy issue when no user opt-in or alternative language is offered. The content does not indicate that the skill is intentionally region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file includes user-facing natural-language text that fixes the tool description to Chinese ('通过 Seedream 4.5 生成图片'). The policy allows locale constraints only when users are given a choice or the restriction is clearly justified; this file does not provide either.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest says the skill is triggered for generic image generation requests via Coze. The CLI exposes a separate 'xhs' mode that constructs a specialized prompt for Xiaohongshu-style feature-card images, which is a specific extra capability not reflected in the skill description.

Content

No source excerpt is available for this finding.