Back to skill

Security audit

抖音视频下载

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Douyin video downloader, but its shell-based download instructions can write local files using externally derived names without validation or confirmation.

Review before installing. Use this only when you explicitly want the agent to fetch a Douyin link, and prefer modifying the instructions to validate video IDs, sanitize filenames, avoid shell interpolation, refuse overwrites, and confirm the final path before writing to ~/Downloads.

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
SKILL.md:43
Finding
Shell Command Injection and Arbitrary File Write Through Unsanitized Output Filename<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 43–52 **Vulnerability Type**: Unsanitized shell command construction **Risk Level**: High ### Vulnerable Code ```bash curl -L "https://aweme.snssdk.com/aweme/v1/playwm/?video_id=<internal_video_id>&ratio=720p&line=0" \ -H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15" \ -H "Referer: https://www.douyin.com/" \ -o ~/Downloads/<output_filename>.mp4 ``` ```markdown - Save to `~/Downloads/` using the video title as filename ``` ### Technical Analysis The skill instructs the agent to construct a shell command by replacing `<output_filename>` with the video title. The output path is not quoted, and the instructions do not require filename validation, path normalization, or shell escaping. Video titles and related share text are externally controlled data. If such data is inserted literally into this command, shell metacharacters such as `;`, `$(...)`, backticks, pipes, or redirection operators can be interpreted by the shell. Spaces or a leading hyphen can also alter command arguments. Path separators and `..` components could cause the output to be written outside `~/Downloads`. The same workflow also interpolates the extracted internal video identifier into the request URL without defining an allowlist. Although the URL is enclosed in double quotes, shell substitutions remain active inside double-quoted strings if unsafe text is inserted directly. Both identifiers and filenames should therefore be validated rather than merely quoted. ### Attack Path 1. An attacker creates or supplies a Douyin video whose title or accompanying share text contains shell metacharacters or path traversal components. 2. The victim asks the agent to download the supplied video. 3. Following the skill instructions, the agent uses the externally derived title as `<output_filename>`. 4. The agent constructs and executes the documented `curl` command without sanit ...[truncated 975 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct the download command through shell string interpolation. Use a process execution API that accepts an argument array and does not invoke a shell. 2. Validate the public video ID as digits only, with an expected length bound. 3. Validate the internal video ID against a strict allowlist such as `^[A-Za-z0-9_-]{1,128}$`; reject all nonmatching values. 4. Derive filenames through a dedicated sanitizer: - Remove path separators, control characters, and shell metacharacters. - Reject `.` and `..` path components. - Remove leading hyphens. - Apply a conservative character allowlist. - Enforce a reasonable maximum length. 5. Resolve and normalize the destination path, then verify that it remains beneath the intended `~/Downloads` directory. 6. Prefer a fixed filename based on the validated video ID, such as `douyin-<validated_id>.mp4`, rather than using remote metadata. 7. If shell execution is unavoidable, quote the complete destination path after sanitization and pass `--` where supported to terminate option parsing. Shell quoting alone must not replace input validation. 8. Create downloads with safe overwrite behavior, such as refusing to replace existing files or generating a unique destination filename. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill directs the agent to write a downloaded file into the user's local ~/Downloads directory without any explicit warning, consent check, or safer temporary-file workflow. Unprompted filesystem writes can surprise users, overwrite existing files, or persist untrusted content locally, which is especially risky when filenames may be derived from remote video metadata.

Vague Triggers

Medium
Confidence
90% confidence
Finding
The skill says users can paste shared Douyin text or links and the AI will automatically download, but it does not define clear trigger boundaries, confirmation requirements, or exclusions. In an agent setting, broad trigger language increases the chance the skill activates on incidental content and performs network access plus file writes without sufficiently explicit user intent.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The workflow explicitly states the AI will automatically construct a download URL and save a video file into ~/Downloads, but it does not prominently warn that local files will be created or ask for consent at execution time. This can surprise users, consume storage, and normalize agent-initiated file writes from untrusted links, which is risky in a tool that processes externally supplied URLs.

Static analysis

No suspicious patterns detected.