Back to skill

Security audit

zhz-image-gen

Security checks for vulnerabilities and agentic risk

Overview

This image generator needs review because it saves undisclosed prompt logs and accepts unrestricted download addresses from API responses.

Before installing, address the unrestricted downloader and disable or explicitly control prompt logging. Prompts and selected reference images go to DashScope or your configured endpoint; that endpoint also receives the API key. Review the automatic key-file fallback and avoid sensitive inputs until these behaviors are understood.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tainted flow: 'url' from os.getenv (line 265, credential/environment) → requests.post (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/main.py (reported line 322)May include surrounding context.

python
try:
        response = requests.post(url, headers=headers, json=body, timeout=300)
    except requests.exceptions.Timeout:
        raise RuntimeError("请求超时(300秒),请稍后重试")
    except requests.exceptions.RequestException as e:

The quick-start workflow submits user prompts to DashScope without an explicit privacy disclosure.

Medium
Category
Output Handling
Confidence
93% confidence
Finding

The quick-start commands instruct users to provide image-generation prompts, and line 3 identifies DashScope as the underlying API. However, the README does not explicitly warn that prompt content is transmitted to a third-party service, which matters when prompts contain sensitive or confidential information.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The generation workflow lacks a privacy warning about sending prompts and reference images to DashScope.

Medium
Category
Output Handling
Confidence
95% confidence
Finding

The examples instruct users to generate images using a local reference image and prompts read from a file. Although the skill identifies DashScope as its API provider, it does not warn that these inputs are transmitted to an external service and may contain sensitive or personal information.

Content

No source excerpt is available for this finding.

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

python
try:
        response = requests.post(url, headers=headers, json=body, timeout=300)
    except requests.exceptions.Timeout:
        raise RuntimeError("请求超时(300秒),请稍后重试")
    except requests.exceptions.RequestException as e:

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

Medium
Category
Data Flow
Confidence
88% confidence
Finding

The script fetches an API-supplied URL after checking only its HTTP/HTTPS prefix, and requests follows redirects by default. An attacker who can influence the API response or a download redirect could cause requests to loopback, private-network, or cloud metadata endpoints, with returned content saved as the output image. Downloading generated images is legitimate, but it does not justify unrestricted access to the runner's network; exploitation depends on control of a response or redirect.

Content

Scanner excerpt · scripts/main.py (reported line 353)May include surrounding context.

python
if image_url.startswith("http://") or image_url.startswith("https://"):
        try:
            img_response = requests.get(image_url, timeout=60)
        except requests.exceptions.RequestException as e:
            raise RuntimeError(f"下载图片失败:{e}")

Static analysis

No suspicious patterns detected.