Back to skill

Security audit

Bilibili Video Summarizer

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned for Bilibili subtitle summarization, but it asks users to paste and persist a login session cookie with weak warnings and unsafe install guidance.

Review before installing. Use this only in a trusted local environment, treat SESSDATA as a login credential, prefer manually creating the cookie file with restrictive permissions, delete or revoke the cookie after use, and avoid the recommended system-level pip install in favor of an isolated pinned installation.

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
references/cookie-setup.md:19
Finding
Authentication Session Cookie Stored Without Enforced Access Controls<![CDATA[ ## Vulnerability Details **File Location**: `references/cookie-setup.md:19-27`; related instructions in `SKILL.md:12-18` **Vulnerability Type**: Plaintext credential storage with unspecified file permissions **Risk Level**: Medium ### Vulnerable Code `references/cookie-setup.md:19-27`: ```markdown ### Method 1: Tell the Agent to Save It When the agent asks for your cookie, paste the full cookie string. The agent will save it to `~/.config/bilibili-cookies.txt` automatically. ### Method 2: Manual Save Save the cookie as a **Netscape HTTP Cookie File**: ``` # ~/.config/bilibili-cookies.txt (Netscape format) .bilibili.com TRUE / TRUE 0 SESSDATA YOUR_SESSDATA_VALUE_HERE ``` ``` Related workflow in `SKILL.md:12-18`: ```markdown ## First Use: Configure Cookie 1. Read [references/cookie-setup.md](references/cookie-setup.md) for instructions on obtaining SESSDATA 2. Guide the user to open Bilibili, log in, press `F12`, open Console, and run `console.log(document.cookie.match(/SESSDATA=([^;]+)/)?.[1])` 3. After the user pastes SESSDATA, save it as a Netscape-format cookie file at `~/.config/bilibili-cookies.txt` 4. If the user already has a cookie file, use it directly ``` ### Technical Analysis The Skill requires a Bilibili authentication cookie for authenticated subtitle retrieval, which is consistent with its declared functionality. Passing that cookie to `yt-dlp` for requests to Bilibili is therefore a necessary network use rather than evidence of unrelated exfiltration. However, the setup instructions require a reusable `SESSDATA` session credential to be pasted into an Agent conversation and stored as plaintext. They do not require the destination directory to have mode `0700`, the cookie file to have mode `0600`, a restrictive `umask`, or validation that an existing file is owned by the current user and is not a symbolic link. The privacy statement that the cookie does not provide control of the account understates the risk. A session cookie ...[truncated 1472 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Avoid asking users to paste session credentials into Agent conversations. Prefer a user-created cookie file, operating-system credential store, or a trusted browser-cookie integration with explicit consent. 2. Create the configuration directory and file with restrictive permissions: ```bash install -d -m 700 "$HOME/.config" umask 077 install -m 600 /dev/null "$HOME/.config/bilibili-cookies.txt" ``` 3. Before use, verify that the cookie file: - Is owned by the current user. - Is a regular file rather than a symbolic link. - Is not readable or writable by group or other users. 4. Write updates atomically through a private temporary file and then rename it into place. 5. Never print the cookie in command output, logs, error messages, or summaries. 6. Revise the privacy warning to identify `SESSDATA` as a sensitive account session credential and explain that theft may permit authenticated actions. 7. Document expiration, revocation, and deletion procedures, and remove the credential when it is no longer needed. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:82
Finding
Unpinned Dependency Installation Bypasses System Python Protections<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:82`; duplicated in `scripts/download.sh:4` **Vulnerability Type**: Unpinned third-party dependency installed into a system-managed Python environment **Risk Level**: Medium ### Vulnerable Code `SKILL.md:82`: ```markdown - **Tool**: `yt-dlp` (`pip3 install yt-dlp --break-system-packages`) ``` Related instruction in `scripts/download.sh:4`: ```bash # Requires: yt-dlp (pip3 install yt-dlp --break-system-packages) ``` ### Technical Analysis The recommended command installs the latest package version available from the configured Python package index without a reviewed version constraint or integrity hash. Consequently, the installed implementation can change after the Skill itself has been audited. The `--break-system-packages` option explicitly bypasses protections intended to prevent `pip` from modifying a Python environment managed by the operating system. This increases the potential impact of dependency conflicts and may replace or alter packages used by unrelated applications. The project does not contain evidence of dependency confusion, typosquatting, or a currently malicious `yt-dlp` release. The risk arises from mutable, unverified package retrieval and unsafe installation scope. ### Attack Path 1. A user follows the documented dependency installation command. 2. `pip` resolves the current `yt-dlp` package and any applicable dependencies from the user's configured package source. 3. A compromised package release, compromised index or mirror, or malicious configuration supplies attacker-controlled package content. 4. Package installation or later invocation executes that content with the privileges of the user running `pip` or `yt-dlp`. 5. Because installation targets a system-managed environment, the malicious or incompatible package may also affect unrelated Python applications using that environment. This attack path depends on compromise or manipulation of the package supply cha ...[truncated 740 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `--break-system-packages` from the installation guidance. 2. Install the dependency in an isolated virtual environment or through `pipx`, rather than modifying the operating system's Python environment. 3. Pin a reviewed `yt-dlp` version instead of implicitly installing the latest release. 4. Where practical, use a locked requirements file with cryptographic hashes, for example: ```text yt-dlp==REVIEWED_VERSION --hash=sha256:REVIEWED_DISTRIBUTION_HASH ``` 5. Download packages only from an explicitly trusted repository over TLS and review any organization-specific package-index configuration. 6. Perform dependency updates through a controlled review process and rerun security checks before changing the pinned version. 7. Run the downloader as an unprivileged user with access only to the required cookie and per-run output directory. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill description emphasizes subtitle download and summarization but omits that it requires a persistent authenticated Bilibili cookie stored locally. Undeclared handling of authentication material is security-relevant because users may provide a session token without understanding that it grants account access and will be stored on disk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill description emphasizes subtitle download and summarization but omits that it requires a persistent authenticated Bilibili cookie stored locally. Undeclared handling of authentication material is security-relevant because users may provide a session token without understanding that it grants account access and will be stored on disk.

Missing User Warnings

High
Confidence
95% confidence
Finding
The skill instructs the user to extract the Bilibili SESSDATA cookie from the browser console and paste it into the system, then save it persistently to disk, without a clear warning that this is effectively an account session credential. Session cookies can enable account takeover or unauthorized use if exposed, and normalizing this collection pattern also trains users into unsafe credential-handling behavior.

Lp3

Medium
Category
MCP Least Privilege
Confidence
77% confidence
Finding
The skill describes reading and writing local files, including a cookie file under the user's home directory, but does not declare any tool scope or permissions. That creates an authorization gap where the agent may access sensitive local data without explicit least-privilege boundaries, increasing the chance of overbroad file access during execution.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger phrases are broad natural-language requests like '这个视频说了什么' and '视频内容是什么', which can match ordinary conversation and cause the skill to activate unexpectedly. In this skill, accidental activation is more concerning because it can lead to prompts for sensitive login cookies and local file operations unrelated to the user's intent.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The guide tells users to paste their SESSDATA cookie directly to the agent and even automates saving it, but does not prominently warn that this cookie is an authentication credential tied to the user's logged-in session. In the context of an agent skill, this is more dangerous because users may assume conversational input is low risk, while providing the token grants the tool account-authenticated access and increases exposure through chat history, logs, or unintended reuse.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The privacy note is misleading because the cookie must be transmitted to bilibili in authenticated requests for the tool to function, so claiming it is 'never sent elsewhere' is materially inaccurate. This can cause users to underestimate how their authentication token is used and mishandle a credential that enables account-authenticated access.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script automatically loads a persistent Bilibili cookie file and transmits it to yt-dlp for any user-supplied URL, but only mentions the cookie after execution begins and does not provide a clear user-facing consent or scope warning. In an agent skill context, this is sensitive because the skill may cause account-authenticated requests using the operator's session token, potentially exposing private account access patterns or enabling misuse if an attacker can influence the URL or trigger behavior unexpectedly.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The script creates an output directory and later writes subtitle files into it. Although an optional output_dir argument exists, there is no explicit warning or disclosure in the script output that it will create directories and save files on disk.

Static analysis

No suspicious patterns detected.