Back to skill

Security audit

Seedance Video

Security checks for vulnerabilities and agentic risk

Overview

This Seedance video skill is mostly coherent, but needs review because it can send its bearer token and request content to any endpoint configured in the environment.

Review the source of AIZNT_PROXY_URLS before installing or running this skill. Only use it where the configured Seedance proxy URLs are trusted HTTPS endpoints, because a bad endpoint configuration could receive the TS_TOKEN credential and submitted prompt or media request data.

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

Error
Location
scripts/client.js:1
Finding
Bearer Token and User Content Can Be Sent to Arbitrary Configured Endpoints<![CDATA[ ## Vulnerability Details **File Location**: `scripts/client.js:1-20, 35-43`; `scripts/seedance.js:51-58, 67-73` **Vulnerability Type**: Unrestricted credential transmission to environment-controlled URLs **Risk Level**: High ### Vulnerable Code From `scripts/client.js:1-20`: ```js /** 从环境变量读取 TS_TOKEN 与 AIZNT_PROXY_URLS */ function loadClient() { const token = (process.env.TS_TOKEN || '').trim(); if (!token) { throw new Error('缺少 TS_TOKEN(天树对话凭证 ts_xxx,对应 skills.entries 的 apiKey)'); } const raw = process.env.AIZNT_PROXY_URLS; if (!raw || !String(raw).trim()) { throw new Error('缺少 AIZNT_PROXY_URLS(JSON 字符串,与 GET /miniapp/ai/chat/credentials 返回的 aiznt_proxy_urls 一致)'); } let urls; try { urls = typeof raw === 'string' ? JSON.parse(raw) : raw; } catch { throw new Error('AIZNT_PROXY_URLS 不是合法 JSON'); } if (!urls || typeof urls !== 'object') { throw new Error('AIZNT_PROXY_URLS 必须是对象'); } return { token, urls }; } ``` From `scripts/client.js:35-43`: ```js function authHeaders(token, extra = {}) { return { Authorization: `Bearer ${token}`, ...extra, }; } async function fetchJson(url, options = {}) { const res = await fetch(url, options); ``` From `scripts/seedance.js:51-58`: ```js const url = urls.seedance_content_generation_tasks; if (!url) throw new Error('AIZNT_PROXY_URLS 缺少 seedance_content_generation_tasks'); const body = bodyFromOpts(); const data = await fetchJson(url, { method: 'POST', headers: authHeaders(token, { 'Content-Type': 'application/json' }), body: JSON.stringify(body), }); ``` From `scripts/seedance.js:67-73`: ```js const tpl = urls.seedance_content_generation_tasks_fetch; if (!tpl) throw new Error('AIZNT_PROXY_URLS 缺少 seedance_content_generation_tasks_fetch'); const url = expandUrl(tpl, { task_id: taskId }); const data = await fetchJson(url, { headers: authHeaders(token) }); console.log(JSON.stringify(data, null, 2)); return; ``` ### Technical Analysis The Skill ...[truncated 2949 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse every configured endpoint using `new URL()` before use and reject malformed URLs. 2. Require the `https:` scheme. Reject `http:`, `file:`, and all other protocols. 3. Maintain an explicit allowlist of trusted Seedance proxy hostnames. Compare normalized `URL.hostname` values rather than using substring or suffix checks that can be bypassed. 4. Restrict ports to the expected secure service ports and reject embedded usernames, passwords, and unexpected URL fragments. 5. Verify that submit and fetch endpoints use approved origins. Prefer constructing fixed API paths from one trusted base URL instead of accepting complete URLs. 6. Add the bearer header only after endpoint validation succeeds. Authentication should fail closed for unapproved destinations. 7. Treat remotely synchronized endpoint configuration as untrusted until its authenticity and integrity have been verified. 8. URL-encode `task_id` with `encodeURIComponent()` before inserting it into a URL template. 9. Add automated tests confirming rejection of plain HTTP endpoints, attacker-controlled domains, deceptive subdomains, embedded credentials, unexpected ports, and unsupported schemes. 10. Consider using separate narrowly scoped credentials for task submission and polling, with short expiration periods and server-side audience restrictions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The documented purpose is a specific Seedance video-generation skill, but the described implementation behavior is largely generic credential loading and HTTP helper logic rather than tightly constrained Seedance-specific processing. This mismatch is dangerous because misleading documentation can cause operators to trust and invoke a skill with broader or different behavior than expected, which can hide risky network actions or secret handling from normal review.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill declares access to environment variables and network-backed endpoints via metadata, but does not declare any explicit tool scope such as permissions or allowed-tools. In agent environments, this weakens least-privilege controls and can allow the skill to use sensitive capabilities without clear policy review, increasing the chance of secret exposure or unintended outbound requests.

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
The tagline is in Chinese while the description is in English, but the manifest does not explain whether the skill requires or defaults to a specific language. This can create a locale/language expectation mismatch without explicit user opt-in or justification.

Missing User Warnings

Low
Confidence
79% confidence
Finding
This code accesses sensitive environment variables (`TS_TOKEN` and `AIZNT_PROXY_URLS`) and returns them for later use, but it provides no user-facing warning, confirmation, or logging that credentials and proxy endpoint data are being consumed. The existing comment and thrown errors are developer-oriented validation messages, not disclosures to the user about sensitive data handling.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
This script presents user-facing validation and help text in Chinese only, including the JSON parsing error and usage instructions. That imposes a specific language on all users without any visible opt-in or alternative locale support, which matches the language/locale policy violation category.

Static analysis

No suspicious patterns detected.