Back to skill

Security audit

Sora2 Video

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its video-generation purpose, but it sends a sensitive bearer token to proxy URLs from configuration without validating that those destinations are trusted HTTPS endpoints.

Install only if AIZNT_PROXY_URLS is supplied by a trusted Tianshu/TsClaw source and points to HTTPS endpoints you trust. Treat TS_TOKEN as a sensitive credential, rotate it if exposed, and avoid running this skill with proxy URL configuration that other users or untrusted skills can modify.

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:7
Finding
Bearer Credential Disclosure Through Unvalidated Proxy URLs<![CDATA[ ## Vulnerability Details **File Location**: `scripts/client.js:7-18`, `scripts/client.js:35-41`, `scripts/sora2.js:53-59`, and `scripts/sora2.js:65-73` **Vulnerability Type**: Server-Side Request Forgery-like credential exfiltration through an unvalidated destination **Risk Level**: High ### Vulnerable Code `scripts/client.js:7-18` loads proxy URLs from an environment-controlled JSON value without validating their schemes or origins: ```js 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 必须是对象'); } ``` `scripts/client.js:35-41` places the sensitive token in the `Authorization` request header and sends the request to the supplied URL: ```js function authHeaders(token, extra = {}) { return { Authorization: `Bearer ${token}`, ...extra, }; } async function fetchJson(url, options = {}) { const res = await fetch(url, options); ``` `scripts/sora2.js:53-59` sends both the Bearer token and user-supplied video-generation request body to the configured submission URL: ```js const url = urls.v2_videos_generations; if (!url) throw new Error('AIZNT_PROXY_URLS 缺少 v2_videos_generations'); const body = bodyFromOpts(); const data = await fetchJson(url, { method: 'POST', headers: authHeaders(token, { 'Content-Type': 'application/json' }), body: JSON.stringify(body), }); ``` `scripts/sora2.js:65-73` sends the Bearer token to the configured task-status URL: ```js const taskId = opts['task-id']; if (!taskId) throw new Error('需要 --task-id'); const tpl = urls.v2_videos_generations_fetch; if (!tpl) throw new Error('AIZNT_PROXY_ ...[truncated 3293 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Enforce HTTPS** - Parse every configured endpoint with `new URL(value)`. - Reject any protocol other than `https:`. - Reject URLs containing embedded usernames or passwords. 2. **Allowlist trusted destinations** - Maintain an explicit list of approved proxy hostnames and ports in code or trusted immutable configuration. - Compare normalized URL origins rather than using substring or suffix-only checks. - Avoid accepting arbitrary hosts merely because they share part of a trusted domain name. 3. **Validate each configured endpoint before use** - Validate `v2_videos_generations` and `v2_videos_generations_fetch` immediately after parsing `AIZNT_PROXY_URLS`. - Reject loopback, link-local, private-network, metadata-service, and other non-approved destinations unless a specifically approved deployment requires them. - Reject malformed URL templates and permit placeholders only in expected path components. 4. **Constrain redirects** - Prefer `redirect: 'manual'` for credential-bearing requests. - If redirects are required, inspect each redirect target and resend credentials only when the target remains on an explicitly approved origin. - Set a conservative redirect limit. 5. **Reduce credential scope** - Use short-lived, revocable, service-scoped tokens limited to the required video submission and status operations. - Avoid using a general conversation or account token if a narrower proxy-specific credential is available. 6. **Protect configuration integrity** - Accept proxy URLs only from a trusted credential service or administrator-controlled configuration. - Prevent untrusted users and unrelated Skills from modifying `AIZNT_PROXY_URLS`. - Log configuration changes without logging the token itself. 7. **Add automated tests** - Verify rejection of HTTP URLs, attacker-controlled hosts, embedded credentials, unexpected ports, malformed templates, and disallowed network r ...[truncated 103 chars]
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 (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding
代码整体与“通过代理提交视频生成任务并获取结果”这一用途基本一致:它加载客户端配置与 token,向视频生成端点提交请求,并根据 task id 查询结果。未发现明显越权、无关资源访问或隐藏能力。唯一实质性不一致在于描述明确提到“轮询结果”,但代码没有循环、重试、等待或持续查询机制,只提供一次性的 `fetch` 命令。因此描述对结果获取方式有夸大,属于轻度但明确的行为不匹配。

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill declares use of environment variables and network access but does not explicitly constrain or document tool scope via permissions or allowed-tools. In a skill that handles bearer tokens and performs outbound requests, this increases the attack surface and makes it harder for a host system or reviewer to enforce least privilege.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documentation instructs the skill to send a Bearer token through proxy URLs but does not provide an explicit warning about token sensitivity, proxy trust boundaries, logging risk, or endpoint validation. Because the token is an authentication credential and all traffic is routed through proxy URLs supplied from environment configuration, misuse or misconfiguration could expose the token to unintended intermediaries and enable account or API abuse.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The tagline is presented in Chinese ("Sora2 文生视频") while the description is in English, but the manifest does not explain whether the skill is intended for a specific locale or how language is selected. This can create an implicit language policy or user experience constraint without explicit opt-in or justification.

Missing User Warnings

Low
Confidence
80% confidence
Finding
This code reads the sensitive environment variables TS_TOKEN and AIZNT_PROXY_URLS, but the only disclosure is an internal Chinese comment and thrown error messages for missing values. There is no user-facing warning, confirmation, or explicit documentation in this file that the skill accesses credentials or proxy configuration from the environment.

Missing User Warnings

Low
Confidence
71% confidence
Finding
The fetchJson helper makes outbound HTTP requests and may transmit authentication headers or other user/system data via the provided options, but this file contains no user-facing warning, confirmation, or descriptive documentation about that network behavior. For a general-purpose client helper, that omission can reduce transparency about external data transmission.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The file contains user-facing text exclusively in Chinese, including validation errors and the usage/help output. This imposes a specific language on users without offering a language choice or documenting a justified locale restriction, which matches the natural-language locale policy concern.

Static analysis

No suspicious patterns detected.