Back to skill

Security audit

wan-text2image

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward DashScope text-to-image skill, with the main caution that prompts are sent to Alibaba's API using the user's configured API key.

Install only if you intend to send prompts to Alibaba DashScope using your DASHSCOPE_API_KEY. Avoid passing untrusted crafted prompt, negative prompt, or size arguments until the script uses JSON-safe encoding and validates the allowed image sizes.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/t2i.sh:20
Finding

Unescaped User Input Allows JSON Request-Body Injection

Content
View full analysis
Remediation
View remediation
[negative_prompt] [size]" >&2 exit 1 fi PROMPT="$1" NEGATIVE_PROMPT="${2:-}" SIZE="${3:-1280*1280}" if [ -z "${DASHSCOPE_API_KEY:-}" ]; then echo "Error: DASHSCOPE_API_KEY environment variable is not set" >&2 exit 1 fi case "$SIZE" in 1280x1280|720x1280|1280x720|1280\*1280|720\*1280|1280\*720) ;; *) echo "Error: unsupported image size" >&2 exit 1 ;; esac payload=$(jq -n \ --arg prompt "$PROMPT" \ --arg negative_prompt "$NEGATIVE_PROMPT" \ --arg size "$SIZE" \ '{ model: "wan2.6-t2i", input: { messages: [{ role: "user", content: [{text: $prompt}] }] }, parameters: { prompt_extend: true, watermark: false, n: 1, negative_prompt: $negative_prompt, size: $size } }') curl --fail-with-body --location \ 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \ --header 'Content-Type: application/json' \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" \ --data-binary "$payload" ``` Additional hardening measures: 1. Enforce an exact allowlist for supported image dimensions using the representation required by the API. 2. Set reasonable maximum lengths for prompts and negative prompts. 3. Use `set -euo pipefail` and `curl --fail-with-body` so local callers can detect failures. 4. Keep the API key exclusively in the environment or a managed secret store and ensure it is never logged. 5. Test inputs containing quotes, backslashes, newlines, and JSON fragments to verify that they remain ordinary string data in the serialized request. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill invokes a shell script directly but does not declare any explicit tool scope or allowed-tools boundary. This creates an authorization gap where the agent may execute shell capabilities more broadly than intended, increasing the risk of command execution pathways being available without clear policy review.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger condition is broad: any request related to AI image generation, text-to-image, or generating images from text may activate the skill. Overly broad activation boundaries can cause unintended invocation, which matters here because the skill can execute shell commands and call an external API using a configured secret.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% 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/t2i.sh (reported line 22)May include surrounding context.

sh
fi

# 调用API
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data "{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script transmits the supplied prompt content to a remote DashScope service and uses a bearer token from an environment variable, but the script provides no user-facing notice beyond a generic comment. For code files, network transmission of user or system data should have some visible disclosure such as a prompt, log message, or documented warning unless clearly communicated to the user.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.