Back to skill

Security audit

UGC 口播种草视频 UGC Testimonial

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its UGC video purpose, but its storyboard processing can write generated video files outside the chosen output folder if unsafe shot IDs are used.

Review this skill before installing. Use it only with storyboards and brand files you trust, keep output directories in a disposable project folder, and restrict shot IDs to simple names such as letters, numbers, underscores, and hyphens. Be aware that prompts and reference images are sent to the selected generation provider, and avoid using the unrelated remove-watermark task unless you have clear rights to the source material.

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.mjs:144
Finding
Unvalidated Storyboard ID Allows Output-Path Traversal## Vulnerability Details **File Location**: `scripts/video.mjs:144-145`, with the write occurring through `scripts/gen.mjs:219-232` **Vulnerability Type**: Path traversal and arbitrary file overwrite **Risk Level**: Medium ### Vulnerable Code ```js // scripts/video.mjs:144-145 const id = sh.id || `s${i + 1}` const save = path.join(o.outdir, `${id}.mp4`) ``` The resulting path is passed to `gen.mjs`, where it is used as a write destination: ```js // scripts/gen.mjs:219-232 if (savePath) { const ext = path.extname(savePath) || f.ext || '.jpg' const base = savePath.slice(0, savePath.length - path.extname(savePath).length) target = files.length > 1 ? `${base}-${i + 1}${ext}` : `${base}${ext}` } else { target = path.join('output', `${Date.now()}-${i + 1}${f.ext || '.jpg'}`) } await mkdir(path.dirname(target), { recursive: true }) const buf = f.buffer || Buffer.from(await (await fetch(f.url)).arrayBuffer()) await writeFile(target, buf) ``` The generated clip paths are subsequently placed in an ffmpeg concat manifest: ```js const listFile = path.join(o.outdir, 'concat.txt') await writeFile(listFile, clips.map((c) => `file '${path.resolve(c)}'`).join('\n')) ``` ### Technical Analysis The `shots[].id` property comes directly from a storyboard JSON file and is incorporated into the output filename without validation. The code does not reject: - Parent-directory components such as `..` - Absolute paths - Platform-specific path separators - Quotes or newline characters - Other characters significant to ffmpeg concat manifests For example, an ID such as `../../target` causes `path.join(o.outdir, "../../target.mp4")` to resolve outside the intended output directory. `gen.mjs` then creates the relevant parent directories and writes the provider-generated content to that path. The path is also inserted into `concat.txt` using single-quoted ffmpeg concat syntax without escaping. A malic ...[truncated 1614 chars]
Remediation
## Remediation Suggestions 1. **Validate storyboard IDs strictly.** Permit only characters required for filenames: ```js const SAFE_ID = /^[A-Za-z0-9_-]+$/ if (!SAFE_ID.test(id)) { throw new Error(`Invalid shot ID: ${id}`) } ``` 2. **Enforce output-directory containment.** Resolve both the base directory and candidate path, then reject escaped destinations: ```js const root = path.resolve(o.outdir) const save = path.resolve(root, `${id}.mp4`) if (path.dirname(save) !== root) { throw new Error('Shot output path escapes the output directory') } ``` 3. **Generate internal filenames independently of untrusted IDs.** Prefer deterministic names such as `shot-1.mp4`; retain the supplied ID only as display metadata. 4. **Harden `gen.mjs` as a second line of defense.** If it is expected to restrict writes to a designated output root, accept that root explicitly and verify containment before calling `mkdir` or `writeFile`. 5. **Safely construct ffmpeg inputs.** Avoid directly interpolating attacker-controlled paths into concat manifests. If concat files remain necessary, reject control characters and correctly escape apostrophes and backslashes according to ffmpeg concat-file rules. 6. **Add regression tests** covering `../`, absolute paths, Windows separators, apostrophes, newlines, Unicode separators, and benign IDs.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (1)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The task list explicitly exposes a `remove-watermark` capability with no accompanying policy checks, authorization constraints, or documented legitimate-use guardrails. In an image/video generation skill, this can facilitate copyright evasion, attribution removal, and misuse of third-party content, making the capability itself security- and abuse-relevant even though this file is only configuration.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/lib/providers.mjs:104

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/video.mjs:69

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/gen.mjs:118

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/lib/providers.mjs:21