Back to skill

Security audit

Bilibili 收藏视频下载

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Bilibili favorites downloader; it uses network access, yt-dlp, and local file writes in ways that match its stated purpose, with storage and bandwidth caveats users should understand.

Install only if you want an agent to run a local Python downloader that contacts Bilibili, invokes yt-dlp, and saves videos to disk. Use --list-only first, then set an explicit output directory, size limit, and max-download value to avoid unexpected bandwidth or storage use.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly drives network access and shell execution via a Python downloader and yt-dlp, but it does not declare any tool scope or permission boundaries. In an agent setting, this weakens security controls and user transparency, increasing the chance the skill can perform broader-than-expected actions such as network fetching and local command execution without clear policy gating.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/download_favorites.py (reported line 29)May include surrounding context.

python
pn: 页码
    ps: 每页数量
    """
    url = f"https://api.bilibili.com/x/v3/fav/resource/list?media_id={fid}&pn={pn}&ps={ps}&keyword=&order=mtime&type=0&tid=0&platform=web"
    
    headers = {
        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/download_favorites.py (reported line 107)May include surrounding context.

python
]
    
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
        if result.returncode == 0:
            info = json.loads(result.stdout)
            return info

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/download_favorites.py (reported line 175)May include surrounding context.

python
print(f"BV号: {bvid}")
    
    try:
        result = subprocess.run(cmd, capture_output=False, text=True)
        if result.returncode == 0:
            print(f"✅ 下载成功: {title}")
            return True, "downloaded"

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README makes clear that the tool downloads videos, but it does not prominently warn that running the skill can trigger bulk network transfers and persistent writes to the user's local filesystem. In an agent/skill context, this matters because users may invoke the skill conversationally without realizing it will save many files, consume disk space and bandwidth, and potentially overwrite organizational expectations about passive assistance versus active file operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill instructs downloading potentially many videos to local storage and even promotes bulk usage, but it does not clearly warn users about disk consumption or that files will be written to the local filesystem. In practice this can lead to unexpected storage usage, clutter, or accidental writes in sensitive environments, especially because the workflow defaults to downloading rather than listing only.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring presents the skill's purpose and behavior only in Chinese. Under the policy rule for language/locale, forcing a single language without user opt-in can be a natural-language policy violation when no alternative or justification is provided.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.