T09 · Insecure Skill Coding Practices
- Location
scripts/submit.sh:60- Finding
TLS Certificate Verification Disabled for Authenticated API Requests and Media Downloads
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This video-generation skill is purpose-aligned, but it uses unsafe shell networking and input handling that could expose the API key or allow command execution through crafted arguments.
Review before installing. Use only with non-sensitive prompts and audio URLs, and do not use current scripts with valuable DashScope credentials until curl -k is removed, inputs are validated, JSON is built safely, and returned media URLs are constrained to expected HTTPS hosts.
scripts/submit.sh:60TLS Certificate Verification Disabled for Authenticated API Requests and Media Downloads
scripts/submit.sh:52Unescaped User Input Allows JSON Request-Structure Injection
scripts/poll.sh:71Unvalidated Timeout Value Is Evaluated as a Bash Arithmetic Expression
The code does match part of the declared purpose: it submits an async DashScope Wan video-generation request using a text prompt. However, the description says the skill should also poll status and download the MP4 locally, which this code does not do. Its behavior ends after submission and task_id extraction. Additionally, the script accepts an optional audio_url parameter, extending functionality beyond a pure text-to-video description. Because key declared lifecycle steps (polling and downloading) are missing, the description does not accurately represent the supplied code chunk.
Using curl -L -k silently bypasses certificate verification without warning the user, defeating HTTPS protections and making network interception or content substitution feasible. Because this skill's purpose is to fetch and save generated media from an external service, transport integrity is security-relevant and disabling it is unjustified by the stated functionality.
The curl -L -k invocation combines redirect following with disabled certificate checks, which can be abused to redirect the client to attacker-controlled infrastructure and download untrusted content. In the context of an agent skill that automatically retrieves a URL returned from prior API calls, this increases the blast radius because a compromised network path or manipulated endpoint can control what is written to disk.
# Download
mkdir -p "$(dirname "$OUT")"
curl -L -k -o "$OUT" "$VIDEO_URL"
FULL=$(python3 -c 'import os,sys; print(os.path.abspath(sys.argv[1]))' "$OUT")
echo "MEDIA: $FULL"
The script invokes curl with the -k flag, which disables TLS certificate validation for the HTTPS request to DashScope. This allows a man-in-the-middle attacker on the network path to intercept or modify the task status response, potentially exposing the Bearer API key and causing the script to trust attacker-controlled status or video URLs.
START=$(date +%s)
while true; do
RESP=$(curl -sS -k --location "https://dashscope.aliyuncs.com/api/v1/tasks/$TASK_ID" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY")
STATUS=$(echo "$RESP" | sed -n 's/.*"task_status"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' | head -n 1)
The curl command uses -k, which disables TLS certificate verification and allows an attacker on the network path to impersonate the DashScope endpoint. Because the request includes the Bearer API key and user content, a successful man-in-the-middle attack could steal credentials, tamper with submitted jobs, or return forged task IDs/results.
The dangerous tool parameter here is curl -k, which weakens the security guarantees of the network client by disabling certificate validation. In this skill, that is especially risky because the same request carries a live API credential and untrusted user-supplied content to a remote endpoint.
DATA="{\"model\":\"$MODEL\",\"input\":{\"prompt\":\"$PROMPT\"$AUDIO_FIELD},\"parameters\":{\"size\":\"$SIZE\",\"prompt_extend\":$PROMPT_EXTEND,\"duration\":$DURATION,\"shot_type\":\"$SHOT_TYPE\"}}"
RESP=$(curl -sS -k --location "$API_URL" \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
The skill advertises and documents shell-based execution paths but does not declare any tool scope or allowed-tools restrictions. That creates an authorization gap where an agent may invoke shell capabilities more broadly than users or platform policy expect, increasing the chance of unintended command execution or file writes.
The skill encourages sending prompts, API credentials, and potentially user-supplied audio URLs to a third-party external service without an explicit warning in the description. This can cause users to disclose sensitive prompts or reference internal/private URLs without informed consent, creating privacy and data-governance risk.
The skill explicitly sends user-controlled content to an external API endpoint using curl with bearer-token authentication. In context, external transmission is expected for a video-generation skill, but it remains security-relevant because prompts, optional audio_url values, and associated metadata leave the local environment and may expose sensitive or internal information if users are not warned.
仅 wan2.6 系列模型支持此功能。通过设置 prompt_extend: true 和 shot_type: "multi" 启用。
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
The script downloads a remote file with curl -k, which disables TLS certificate validation and allows a man-in-the-middle attacker to spoof the video host and supply arbitrary content. In this skill, the downloaded artifact is saved locally and presented as the generated media, so the insecure transport directly affects integrity of the output and could also expose the user to malicious files disguised as MP4 content.
This script intentionally sends prompt data, optional audio_url metadata, and an authorization token to an external service. In a video-generation skill this external transmission is expected, but it still represents a real security/privacy boundary crossing, especially if users provide confidential text or internal resource references.
DATA="{\"model\":\"$MODEL\",\"input\":{\"prompt\":\"$PROMPT\"$AUDIO_FIELD},\"parameters\":{\"size\":\"$SIZE\",\"prompt_extend\":$PROMPT_EXTEND,\"duration\":$DURATION,\"shot_type\":\"$SHOT_TYPE\"}}"
RESP=$(curl -sS -k --location "$API_URL" \
-H 'X-DashScope-Async: enable' \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
The script transmits the user-supplied prompt and optional audio URL to Alibaba Cloud's external API, but provides no explicit warning, confirmation, or data-handling notice. In this skill context, users may include sensitive prompts or internal URLs, so silent exfiltration to a third party creates a real privacy and compliance risk.
The skill description and title include Chinese phrases such as "百炼/通义万相/wan 文生视频" and "文生视频" alongside English, which can impose a language expectation in the skill's natural-language interface. Because there is no explicit opt-in or statement that the user may interact in their preferred language, this may conflict with language/locale choice policy.
The comment at L52 says 'Build JSON (avoid jq dependency)', which suggests a simplified, dependency-light implementation. However, the script still depends on curl for network submission and sed/head for parsing the JSON response, so the inline documentation overstates how dependency-free the implementation is.
No suspicious patterns detected.