Back to skill

Security audit

推特视频下载器

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Twitter/X media downloader, but its proxy handling can let a crafted proxy value change yt-dlp options and potentially run unintended local behavior.

Review before installing. The downloader does what it says at a high level, but do not pass proxy values from untrusted sources, and prefer a fixed local proxy URL you control. The publisher should change proxy argument construction to shell arrays and validate proxy URLs before this is treated as low-risk.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/download.sh:93
Finding
Unquoted Proxy Argument Expansion Enables yt-dlp Option Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/download.sh:93-97`, with vulnerable expansions at `scripts/download.sh:109-116` and `scripts/download.sh:146-153` **Vulnerability Type**: Command-line option injection through unsafe shell argument construction **Risk Level**: High ### Vulnerable Code ```bash # Build proxy args PROXY_ARGS="" if [[ -n "$PROXY" ]]; then echo "🌐 Proxy: $PROXY" PROXY_ARGS="--proxy $PROXY" fi ``` The resulting scalar is expanded without quoting in audio-download mode: ```bash if ! yt-dlp \ --extract-audio \ --audio-format mp3 \ --audio-quality 0 \ --output "$AUDIO_DIR/%(title)s_%(id)s.%(ext)s" \ --no-warnings \ --progress \ $PROXY_ARGS \ "$URL" 2>&1; then ``` The same unsafe expansion occurs in video-download mode: ```bash if ! yt-dlp \ --format "$FORMAT" \ --merge-output-format mp4 \ --output "$OUTPUT_DIR/%(title)s_%(id)s.%(ext)s" \ --no-warnings \ --progress \ $PROXY_ARGS \ "$URL" 2>&1; then ``` ### Technical Analysis The proxy value is user-controlled and is concatenated into the scalar variable `PROXY_ARGS`. Expanding `$PROXY_ARGS` without quotes causes Bash to perform word splitting and pathname expansion. Consequently, whitespace inside the supplied proxy value can produce additional command-line arguments. Those additional arguments are passed directly to `yt-dlp` and interpreted as options rather than as part of the proxy address. This does not create direct shell metacharacter evaluation because the shell does not parse operators introduced by parameter expansion as new shell syntax. However, it creates an option-injection vulnerability. This is security-sensitive because `yt-dlp` exposes options that can invoke external commands, including execution hooks. An attacker can inject such an option and cause attacker-selected local behavior when the download is processed. ### Attack Path 1. An attacker gains control over, or persuades a user or automation process to use, ...[truncated 1699 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Store command arguments in a Bash array so that every logical argument remains a single argument: ```bash PROXY_ARGS=() if [[ -n "$PROXY" ]]; then echo "🌐 Proxy: configured" PROXY_ARGS=(--proxy "$PROXY") fi ``` Expand the array safely at both call sites: ```bash yt-dlp \ --extract-audio \ --audio-format mp3 \ --audio-quality 0 \ --output "$AUDIO_DIR/%(title)s_%(id)s.%(ext)s" \ --no-warnings \ --progress \ "${PROXY_ARGS[@]}" \ "$URL" ``` Apply the same change to video-download mode. Additional hardening should include: 1. Validate proxy URLs against an allowlist of supported schemes, such as `http`, `https`, `socks4`, `socks5`, and `socks5h`. 2. Reject proxy values containing control characters, line breaks, or invalid URL components. 3. Ensure required option values exist before reading `$2`. 4. Avoid logging proxy credentials because proxy URLs may contain usernames or passwords. 5. Add regression tests confirming that spaces and strings resembling `yt-dlp` options remain part of one proxy argument or are rejected. ]]>

T08 · Insecure Dependencies

Note
Location
README.md:108
Finding
Third-Party Dependencies Are Installed Without Version or Integrity Pinning<![CDATA[ ## Vulnerability Details **File Location**: `README.md:108-115` **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Low ### Vulnerable Code ```bash # Ubuntu/Debian sudo apt install yt-dlp ffmpeg # macOS brew install yt-dlp ffmpeg # 或使用 pip pip install yt-dlp ``` ### Technical Analysis The documented installation commands retrieve the versions currently exposed by operating-system repositories, Homebrew, or the Python package index. No tested version constraints, package hashes, lockfile, or integrity verification procedure is provided. The referenced dependencies are legitimate and no evidence of dependency confusion, typosquatting, or a currently malicious package was identified. Nevertheless, mutable dependency resolution makes installations non-reproducible and causes the Skill to inherit the security state of whichever package release and repository metadata are available at installation time. This is particularly relevant because `yt-dlp` processes remote media metadata and `ffmpeg` parses complex, attacker-influenced media formats. A compromised or unexpectedly vulnerable dependency would execute or process data with the invoking user's privileges. ### Attack Path 1. A user follows one of the documented installation commands. 2. The package manager resolves the latest or repository-selected dependency version rather than a version explicitly tested with this Skill. 3. An upstream package, repository, distribution channel, or newly released version is compromised or contains a security regression. 4. The affected dependency is installed. 5. The dependency runs during media inspection, downloading, conversion, or post-processing with the invoking process's permissions. This is a supply-chain exposure rather than evidence that the currently named packages are malicious. ### Impact Assessment Impact depends on the nature of a compromised or vulnerable dependency. In the worst case, malicious dependency co ...[truncated 538 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Document exact dependency versions that have been tested with the Skill. 2. For Python installation, use an exact version and verify the downloaded artifact against a trusted hash, for example through a requirements file using `--require-hashes`. 3. For operating-system package managers, document trusted repositories and the tested package versions available from those repositories. 4. Avoid recommending privileged installation where a user-scoped or isolated environment is sufficient. 5. Periodically update pinned versions after vulnerability review and compatibility testing. 6. Add dependency scanning for known vulnerabilities in `yt-dlp`, `ffmpeg`, and their transitive components. 7. Clearly distinguish reproducible installation instructions from optional commands that intentionally retrieve the newest upstream release. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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
Findings (9)

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# Ubuntu/Debian
sudo apt update && sudo apt upgrade yt-dlp

# 或使用官方更新
yt-dlp -U
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
代码整体主用途与声明大体一致,确实是 Twitter/X 媒体下载器,并支持音频提取、MP4 输出和代理提示。但描述包含了代码未实际实现或未明确支持的重要能力:一是分辨率方面,帮助信息和参数解析只支持 best、1080、720、480、360,未提供 2K、4K、8K 选项;二是声明提到 GIF 下载,而脚本逻辑仅面向 status URL 的视频/音频下载,没有专门的 GIF 处理或相关格式说明。因此描述存在夸大/不准确之处,属于能力声明与实际行为不一致。

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
声明的核心能力是“下载 Twitter/X 视频、GIF 和音频,并支持多种高清分辨率”。但实际代码是一个 info.sh 脚本,明确使用 --dump-json 和 --no-download,仅抓取并打印媒体元数据与可用格式信息,没有执行任何下载、转码、音频提取或保存文件的操作。虽然输出中提到了 download.sh 命令,暗示系统中可能存在下载脚本,但在当前提供的代码片段里并未实现这些已声明的主要能力。因此,依据‘描述是否准确代表所提供代码块实际行为’这一标准,应判定为不匹配。

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The text says the skill is '专为中国大陆用户优化', which imposes a region-specific audience framing in the skill description. Under the policy, locale-specific targeting should either be optional for users or clearly justified as a compliance or region-locked requirement, which is not established here.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt install yt-dlp ffmpeg

# macOS
brew install yt-dlp ffmpeg
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
# Ubuntu/Debian
sudo apt install yt-dlp ffmpeg

# macOS
brew install yt-dlp ffmpeg
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The line states the tool is '专为中文用户打造' ('built specifically for Chinese users'), which imposes a locale-specific framing in the skill’s natural-language description. The file does not offer an opt-in choice for language or explain a justified compliance-based regional restriction.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The phrase 'Made with ❤️ for Chinese users' explicitly restricts the intended audience by locale/language in natural language. There is no accompanying option for other languages or explanation that would justify the constraint under the stated policy.

Natural-Language Policy Violations

Low
Confidence
80% confidence
Finding
The closing lines explicitly brand the tool as made for Chinese users. This is natural-language locale targeting that does not provide a user choice or explain a necessary regional limitation.

Static analysis

No suspicious patterns detected.