Back to skill

Security audit

Seedance 2 Prompt Engineering Video Gen

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but its helper script can upload arbitrary local files to WeryAI as image inputs without code-enforced approval.

Review before installing. Use public HTTPS image URLs rather than local paths, keep WERYAI_API_KEY limited or short-lived, and do not allow automation to pass untrusted image or images values into the CLI. Treat each submit or wait as a paid network action requiring explicit approval.

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/video_gen.js:206
Finding
Unrestricted Local File Read and Upload Through Image Parameters<![CDATA[ ## Vulnerability Details **File Location**: `scripts/video_gen.js`, lines 206–283 **Vulnerability Type**: Arbitrary local-file disclosure to a third-party service **Risk Level**: Medium ### Vulnerable Code ```javascript async function uploadFileToPublicUrl(inputPath, apiKey) { const resolvedPath = normalizeLocalFilePath(inputPath); if (!resolvedPath) { throw new Error(`Invalid local image path: ${inputPath}`); } const filePath = resolvedPath instanceof URL ? fileURLToPath(resolvedPath) : path.resolve(resolvedPath); let stat; try { stat = await fs.stat(filePath); } catch { throw new Error(`Local image file not found: ${inputPath}`); } if (!stat.isFile()) { throw new Error(`Local image path is not a file: ${inputPath}`); } const fileBuffer = await fs.readFile(filePath); const fileName = path.basename(filePath); const mimeType = inferMimeType(filePath); const form = new FormData(); form.append('batch_no', makeUploadBatchNo()); form.append('fixed', 'false'); form.append('file', new Blob([fileBuffer], { type: mimeType }), fileName); const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), 60_000); let res; try { res = await fetch(MODELS_BASE_URL + UPLOAD_API_PATH, { method: 'POST', headers: { Authorization: `Bearer ${apiKey}`, }, body: form, signal: controller.signal, }); } catch (err) { clearTimeout(timer); if (err.name === 'AbortError') { throw new Error(`Upload timeout: ${filePath}`); } throw err; } clearTimeout(timer); let data; try { data = await res.json(); } catch { throw new Error(`Upload failed with non-JSON response (HTTP ${res.status}).`); } const wrapped = { httpStatus: res.status, ...data }; if (!isApiSuccess(wrapped)) { const apiErr = formatApiError(wrapped); throw new Error(apiErr.errorMessage || `Upload failed (HTTP ${res.status}).`); } ...[truncated 3712 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Disable local-file handling by default.** Accept only public HTTPS URLs unless the caller supplies an explicit option such as `--allow-local-upload`. 2. **Require file-specific approval.** Before reading a file, display its canonical path, size, and destination host and require affirmative confirmation. For noninteractive use, require a separate explicit flag for each approved path. 3. **Constrain accessible paths.** Resolve the canonical path with `fs.realpath()` and ensure it remains inside a caller-designated upload directory. 4. **Validate actual image content.** Allowlist supported extensions and verify file signatures or decode the image before upload. Reject `application/octet-stream`. 5. **Apply size limits.** Check `stat.size` before reading and reject files above a conservative limit. Prefer bounded streaming where the API supports it. 6. **Address link traversal.** Use `lstat()` and reject symbolic links, or canonicalize the target and reapply the approved-directory constraint. 7. **Separate capabilities.** Keep URL-based generation independent from local-file upload so normal generation runs do not require filesystem-read behavior. 8. **Preserve documentation controls.** Retain the existing consent warnings in `SKILL.md` and the API guide, but treat them as supplementary safeguards rather than substitutes for runtime enforcement. ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The documented behavior claims explicit pre-submit confirmation and Seedance-specific prompt-engineering safeguards, but the detected implementation apparently also uploads local files, performs polling, exposes generic task lookup, and lacks the promised confirmation logic. This mismatch is dangerous because users and orchestrators may trust the safer documented workflow while the actual code performs broader, potentially paid or privacy-impacting actions.

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**Dependencies:** `WERYAI_API_KEY` + Node.js **18+**. After assembly, **`scripts/video_gen.js`** and **`resources/`** must include **[`resources/WERYAI_VIDEO_AP
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares network and environment-variable dependencies but does not constrain tool scope with explicit permissions or allowed-tools. In agent environments, that increases the chance the skill can access secrets or make external requests beyond what users expect, weakening least-privilege controls.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The description explicitly says the skill will "Design production English prompts," which imposes a language choice as part of the workflow. Elsewhere the document reinforces this requirement rather than offering the user a language option or explaining a justified locale restriction.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The line states that the agent should "always expand short input into a production English prompt" unless the user already supplied a finished long prompt and opted out of rewriting. This is a natural-language policy issue because it enforces English output without giving the user a language or locale choice.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The scenario section says to "Build one English `prompt`", which again hardcodes a specific language for generated content. Because no opt-in or justified locale restriction is provided at this point, it violates the language/locale policy criterion.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
The text says to use these terms in 'Seedance 2.0 English prompts,' which imposes a specific language requirement in natural language. The file does not provide an opt-in, alternative locale, or justification that this resource is limited to English-only usage.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Line L003 states the recipes are 'Production-ready English prompt blocks,' which imposes a specific language preference in the skill content. Because the file does not present this as optional or explain a justified locale constraint, it conflicts with the policy against forcing a language without user opt-in.

Static analysis

No suspicious patterns detected.