Back to skill

Security audit

视频下载与转录(Whisper)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent video-download-and-transcription helper, but it includes under-scoped network requests and credential-cookie guidance that users should review carefully before installing.

Install only if you are comfortable with the agent running video downloader and transcription commands, making outbound requests to video sites, and writing media/transcript files locally. Avoid using browser cookies or cookie files unless you understand they are account credentials, and prefer public URLs or explicitly scoped cookie handling in an isolated environment.

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

Warning
Location
scripts/bilibili-download.sh:17
Finding

Unrestricted User-Supplied URL Enables Blind Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scripts/bilibili-download.sh, line 17
Vulnerability Type: Blind server-side request forgery through an unrestricted URL
Risk Level: Medium

Vulnerable Code

bash
BV=$(curl -sI "$INPUT" 2>/dev/null | grep -i location | grep -oE 'BV[a-zA-Z0-9]+' | head -1)

Technical Analysis

When the first argument is not syntactically recognized as a Bilibili BV identifier, the script passes it directly to curl. The argument is properly shell-quoted, so this is not shell command injection; however, no URL scheme, hostname, destination address, or port validation is performed.

Consequently, a caller can cause the environment running the skill to issue a HEAD request to an arbitrary destination accessible from that environment. This includes loopback services, private network hosts, cloud metadata services, and other endpoints unavailable to the external caller.

The response is filtered for a Location header containing a BV-like value, which limits direct response disclosure. Nevertheless, observable success, failure, timing, and script behavior can provide a blind SSRF oracle. An internal endpoint returning an attacker-influenced redirect with a BV-like value could also cause the workflow to proceed using that identifier.

Attack Path

  1. An attacker supplies a URL instead of a valid BV identifier, such as an internal HTTP endpoint or a loopback service.
  2. An agent or user invokes bilibili-download.sh with that attacker-controlled argument.
  3. The script executes curl -sI against the supplied destination from the skill runner's network context.
  4. The attacker compares completion time, failure behavior, or subsequent script output to infer whether the destination is reachable.
  5. By repeating requests against different hosts and ports, the attacker may perform blind internal-network discovery. If a reachable endpoint performs an action on a HEAD request, that act ...[truncated 574 chars]
Remediation
View remediation

Remediation Suggestions

  • Parse the input as a URL and allow only https.
  • Restrict accepted hostnames to the intended Bilibili short-link domains, such as an exact allowlist containing b23.tv.
  • Reject URLs containing user information, unexpected ports, malformed hostnames, or non-HTTPS schemes.
  • Resolve the hostname before making the request and reject loopback, link-local, private, multicast, reserved, and unspecified IP ranges for both IPv4 and IPv6.
  • Protect against DNS rebinding by ensuring that the address used for the connection is the validated address.
  • Apply strict connection and total timeouts, response-size limits, and a limited redirect count.
  • Revalidate the hostname and resolved address at every redirect hop if redirects are enabled.
  • Prefer accepting only a BV identifier. If short-link expansion is necessary, isolate it in a network sandbox without access to internal services.

Example validation approach:

bash
case "$INPUT" in
    https://b23.tv/*) ;;
    *)
        echo "Error: only HTTPS b23.tv short links or BV identifiers are accepted"
        exit 1
        ;;
esac

Hostname allowlisting should be supplemented with resolved-address validation rather than relying solely on a string prefix.

T08 · Insecure Dependencies

Note
Location
SKILL.md:150
Finding

Unpinned Package Installation Creates a Non-Reproducible Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 150-157
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Low

Vulnerable Code

bash
# yt-dlp installation
pip3 install yt-dlp

# ffmpeg installation (macOS)
brew install ffmpeg

# Whisper installation
pip3 install -U openai-whisper

Technical Analysis

The installation instructions retrieve mutable latest versions of yt-dlp, ffmpeg, and openai-whisper without version constraints, lockfiles, artifact hashes, or repository/source verification. The -U option for Whisper explicitly upgrades to whichever release is current at execution time.

This makes installation non-reproducible: identical skill executions at different times can install different code. If an upstream release, package registry account, distribution repository, or transitive dependency is compromised, the installation may introduce attacker-controlled code after the skill itself has already been reviewed.

The project does not demonstrate that any named dependency is currently malicious. This finding concerns the unsafe dependency acquisition process and the trust placed in mutable upstream artifacts.

Attack Path

  1. An upstream project, package publisher account, package registry, Homebrew formula, or transitive dependency is compromised.
  2. A malicious or vulnerable release becomes the latest version under one of the documented package names.
  3. A user follows the skill instructions and runs the unpinned installation command.
  4. The package manager downloads and installs the altered release.
  5. Package installation hooks or later invocation of yt-dlp, ffmpeg, or whisper executes the compromised component with the installing user's privileges.

This attack path requires compromise or malicious modification of a trusted upstream source; no dependency-confusion source or typo-squatted package is present in the audited files. ...[truncated 544 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin each dependency to a reviewed version rather than installing the mutable latest release.
  • Maintain a lockfile that includes all transitive Python dependencies.
  • Require hashes for Python packages, for example through a generated requirements file used with pip install --require-hashes.
  • Install dependencies inside a dedicated virtual environment or isolated container.
  • Record the expected package index and prohibit untrusted extra indexes.
  • Pin the Homebrew formula or provide a verified container image or signed release artifact with a documented digest.
  • Automate dependency updates through reviewed pull requests with vulnerability and provenance checks.
  • Avoid automatic -U upgrades during ordinary skill execution.
  • Where supported, verify package signatures, attestations, checksums, and software bills of materials before deployment.

A hardened Python installation flow should resemble:

bash
python3 -m venv .venv
.venv/bin/python -m pip install --require-hashes -r requirements.lock

The lockfile should contain exact versions and approved SHA-256 hashes generated from reviewed artifacts.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明的核心能力包括三步:下载目标视频网站内容、提取音频、再用 Whisper 转录为文字。代码只实现了前两步中的 B 站特化版本:解析 BV 号/短链接,下载 B 站视频,并导出 WAV 音频。最关键的“转录成文字”完全缺失,因此主功能与声明存在实质偏差。此外,声明暗示可处理多个视频网站(如 B站、YouTube 等),但该脚本只构造并下载 bilibili.com/video/BV 链接,没有体现跨站支持。虽然下载和音频提取与声明部分一致,但不足以覆盖声明的主要用途,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

代码的核心功能只是“音频转录”:检查 Whisper 是否可用、验证输入音频文件存在、运行 Whisper 生成 txt 转录结果并输出预览。声明中的关键能力包括“下载无法直接访问的视频网站内容”和“提取音频”,但这些在代码中完全没有体现。因此,实际行为只覆盖了声明中的最后一步(转录),与整体宣称的主要用途存在实质性不一致。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation recommends using browser cookies for member-only content but does not provide a strong privacy or sensitive-data warning. Browser cookies are highly sensitive authentication artifacts; exposing or mishandling them can lead to account compromise and unauthorized access far beyond the immediate video task.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 264)May include surrounding context.

bash
# 删除损坏的模型缓存
rm -rf ~/.cache/whisper/*

# 重新下载
whisper /tmp/audio.wav --model base

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 264)May include surrounding context.

bash
# 删除损坏的模型缓存
rm -rf ~/.cache/whisper/*

# 重新下载
whisper /tmp/audio.wav --model base

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill clearly instructs use of shell-capable tools (curl, yt-dlp, ffmpeg, whisper, shell scripts) but does not declare any permissions or allowed-tools scope. That creates an authorization gap where an agent may execute networked downloads, file writes, and script invocations without explicit tool boundaries, increasing the chance of overbroad execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description is written as a Chinese-only instruction set and does not indicate that users may choose another language or that the locale restriction is intentional and justified. SQP-3 requires flagging language or locale policy violations when a specific language is imposed without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill performs outbound requests to third-party platforms and writes downloaded media and transcripts to /tmp or workspace locations without clearly warning about these side effects. Lack of disclosure is dangerous because users or agents may unknowingly fetch remote content, consume disk space, or persist potentially sensitive media/transcripts locally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The skill explicitly transmits data to external services (b23.tv, api.bilibili.com, and other video platforms) as part of its workflow. External transmission is expected for a downloader, but it is still security-relevant because user-supplied URLs and metadata leave the local environment and may expose browsing intent, identifiers, or downloaded content sources.

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

curl -sI "https://b23.tv/短链接" 2>/dev/null | grep -i location

获取完整视频信息(包含cid)

curl -s "https://api.bilibili.com/x/web-interface/view?bvid=BV号"

text

### 获取所有视频的BV号

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documentation expands the workflow to use browser cookies for gated or member-only content, introducing access to authenticated session material beyond the core transcription task. Handling browser-derived credentials materially raises risk of privacy exposure, account misuse, and unauthorized access if agents or users follow the guidance casually.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Troubleshooting instructions that recommend authenticated downloads via cookie files add credential-handling behavior not justified by a basic download/transcription workflow. This increases the chance that sensitive session cookies are stored, reused, or exposed in logs, scripts, or shared environments.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The comments and user-visible output strings are entirely in Chinese, including usage text and error messages. For a general-purpose transcription script, this imposes a specific language/locale on users without opt-in or justification, which matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.