Back to skill

Security audit

link-resolver-engine

Security checks for vulnerabilities and agentic risk

Overview

This video-downloader skill mostly matches its purpose, but it automatically installs software and has weak URL and file-path controls that could affect the host beyond a simple download.

Review before installing. Use only in a contained environment, avoid giving it arbitrary URLs or custom filenames/paths, and prefer a version that requires preinstalled pinned dependencies, validates exact Bilibili/Douyin hosts before any request, and confines downloads to a dedicated directory without overwriting existing files.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/video_snapper.py:246
Finding

Arbitrary Outbound Request Before Platform Validation Enables SSRF

Content
View full analysis
str: try: resp = requests.head(url, allow_redirects=True, timeout=timeout) final_url = resp.url except: final_url = url parsed = urlparse(final_url) domain = parsed.netloc.lower() if any(d in domain for d in ['douyin.com', 'v.douyin', 'iesdouyin.com', 'tiktok.com']): return "抖音" elif any(d in domain for d in ['b23.tv', 'bilibili.com', 'bili']): return "B站" return "未知平台" ``` ### Technical Analysis The command-line URL is passed directly to `requests.head()` before the application validates its scheme, hostname, resolved IP address, or platform. The request also uses `allow_redirects=True`, so every redirect destination is contacted without validation. Consequently, a caller can cause the process to issue HTTP requests to destinations outside the declared Bilibili and Douyin scope, including: - Loopback services such as `127.0.0.1` or `::1` - RFC 1918 private-network addresses - Link-local services - Cloud instance metadata endpoints - An attacker-controlled URL that redirects to an internal service Although the response body is not returned directly, HTTP methods can still trigger side effects on poorly designed internal endpoints. Status-dependent timing and subsequent platform classification may also provide limited network-reachability information. ### Attack Path 1. An attacker supplies a URL pointing to an internal address, local service, or external redirector: ```text http://127.0.0.1:8080/internal-action ``` 2. `identify_platform_with_redirect()` invokes `requests.head()` before checking whether the destination belongs to an approved platform. 3. The Python process conn ...[truncated 811 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/video_snapper.py:252
Finding

Substring-Based Domain Validation Accepts Attacker-Controlled Hosts

Content
View full analysis
Remediation
View remediation
bool: return host == allowed or host.endswith("." + allowed) ``` 4. Avoid broad tokens such as `bili` and `v.douyin`. 5. Maintain separate approved host sets for each platform. 6. Revalidate the final hostname after every redirect. 7. Reject URLs containing user information, unsupported ports, malformed hostnames, or non-HTTP schemes. 8. Add regression tests for deceptive domains such as: ```text bilibili.com.attacker.example attacker-bili.example douyin.com.attacker.example ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/douyin_video.py:151
Finding

Unsanitized User-Controlled Filenames Permit Path Traversal and File Overwrite

Content
View full analysis
|]', '_', title) filename = f"{safe_title}_{timestamp}.mp4" if not filename.endswith(".mp4"): filename += ".mp4" final_file = os.path.join(download_dir, filename) temp_video = os.path.join(download_dir, f"temp_video_{timestamp}.mp4") temp_audio = os.path.join(download_dir, f"temp_audio_{timestamp}.m4a") if audio_url else None ``` ```python else: # 【核心改动】如果没有音频轨,直接将下载好的视频流文件重命名为最终的目标文件 logger.info("检测到无独立音频流,直接生成视频文件...") if os.path.exists(final_file): os ...[truncated 2354 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/ensure_package.py:24
Finding

Import-Time Installation of Unpinned Dependencies and External Executables

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (67)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · .gitignore (reported line 29)May include surrounding context.

text
venv/
ENV/
env/
.env

# Logs
logs/*.log

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Automatically downloading and installing FFmpeg, modifying PATH, and supporting TikTok despite a stated Bilibili/Douyin-only scope is a significant hidden capability expansion. Network-fetching executables and altering the runtime environment create supply-chain and persistence risks, while undeclared broader platform support undermines trust boundaries.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file implements a generic package installation mechanism, not Bilibili/Douyin link resolution or video downloading as declared in the manifest. Capability mismatch is dangerous because it hides privileged behavior behind an unrelated skill description, reducing user/operator awareness and increasing the chance of abuse.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The module modifies the Python environment at import time by reinstalling packaging infrastructure before any explicit user action. Import-time side effects are especially dangerous because merely loading the module triggers network/package-management behavior and environment mutation, enabling unexpected code execution paths and making review harder.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This module can install arbitrary packages from remote repositories and local archives, including git sources and zip files. That is effectively an extensible code execution mechanism with supply-chain exposure, and it is unjustified for a skill that is supposed to process only Douyin/Bilibili video links.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file behavior materially diverges from the declared skill purpose: instead of resolving and downloading only Douyin/Bilibili videos, it acts as an environment bootstrapper with system inspection and dependency-management capabilities. Capability mismatch increases risk because users and reviewers may grant trust based on the narrow declared purpose while the code performs broader host-level actions.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/env_manager.py (reported line 222)May include surrounding context.

python
sys.exit(1)

    # 传递环境变量防止递归
    env = os.environ.copy()
    env["RUNNING_IN_VENV"] = "true"

    logger.info(f"   当前Python: {sys.executable}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README emphasizes parsing and downloading from third-party platforms but does not clearly warn users that the skill performs outbound network requests and browser automation against external sites. In an agent environment, undisclosed network activity can expose IP, cookies/session context, and browsing fingerprints, and may violate user expectations or enterprise policy.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README claims a constrained default download location but also documents a user-controlled --download-dir option and examples writing to arbitrary paths such as F:/. That expands the skill from a fixed-output downloader into a filesystem write primitive, which can overwrite or place files in unexpected locations if the agent passes through user input unchecked.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation describes automatic local file creation and directory usage without a prominent warning or consent boundary. In an agent setting, silent writes can surprise users, consume disk space, or be combined with arbitrary path selection to place content in sensitive or synced locations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Documented automatic installation of Python packages and browser binaries materially increases the skill's privileges and changes the host environment beyond merely downloading videos. This creates supply-chain and persistence risk because executing installers or fetching runtime components can introduce unreviewed code onto the system.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises behavior that requires shell, network, environment access, and file writes, but it does not declare any explicit tool scope or permission boundaries. In practice this makes the skill harder to constrain and review, increasing the risk that broad capabilities are invoked unexpectedly or abused through prompt-triggering.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include very generic requests such as '把这个视频下下来' and '帮我处理这个视频链接', which can cause the skill to activate on unrelated video requests. In a skill with network, shell, and file-write behavior, overbroad triggering raises the chance of unintended downloads, misuse on unsupported sites, or stealthy invocation without clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description does not prominently warn that invocation will make network requests and download files to local storage. This weakens informed consent and can lead users or operators to trigger potentially invasive actions without understanding the side effects, especially given the shell and file-write behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger logic permits generic keywords without clear exclusion rules, creating ambiguity about when the skill should run. Because the skill is designed to perform network downloads and local file writes, ambiguous activation increases the likelihood of accidental or attacker-induced execution in unrelated conversations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill automatically installs Python packages and a browser at runtime, which materially exceeds simple link resolution and download behavior. In a hostile or shared environment this can introduce unreviewed code, change dependency state, consume network/resources, and create persistence-like side effects without clear authorization.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Automatic package installation and browser setup occur without user-facing warning or confirmation, causing environment modification and network activity as a hidden side effect. In an agent skill, hidden setup actions are risky because a simple content-handling request can unexpectedly mutate the host system.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

The skill performs a runtime subprocess call to install Chromium via Playwright as soon as the module is imported. That creates an unexpected code-execution and software-installation side effect, expands the host attack surface, and can modify the environment without user consent; in an agent setting, this is more dangerous because mere invocation/import of the skill can trigger system changes.

Content

Scanner excerpt · scripts/bilibili_video.py (reported line 59)May include surrounding context.

python
ensure_package.pip("tf-playwright-stealth")
ensure_package.pip("yt-dlp")
# 安装 chromium 浏览器
subprocess.check_call([sys.executable, "-m", "playwright", "install", "chromium"])
import requests
import yt_dlp
from yt_dlp.utils import DownloadError  # 专门捕获 yt_dlp 下载错误

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/bilibili_video.py (reported line 102)May include surrounding context.

python
def get_wbi_keys(session: requests.Session) -> tuple:
    """获取 B站当前生效的临时 img_key 和 sub_key"""
    try:
        resp = session.get("https://api.bilibili.com/x/web-interface/nav", timeout=5)
        res_json = resp.json()
        wbi_img = res_json.get("data", {}).get("wbi_img", {})
        img_url = wbi_img.get("img_url")