Back to skill

Security audit

Bilibili Comment

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Bilibili comment-report tool that uses the Yige API and local HTML files, with some implementation risks users should understand before using generated reports.

Install only if you are comfortable using a Yige API key and sending queried Bilibili video IDs/comment metadata to yige.zone. Treat generated HTML reports as untrusted files if the source video, API response, or analysis JSON could be attacker-influenced, and avoid sharing/opening reports from untrusted inputs until the HTML escaping issues are fixed.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backfill_html.py:28
Finding

Stored HTML Injection Through Unvalidated Analysis Data

Content
View full analysis
{{SUMMARY_POSITIVE}}
...
{{SUMMARY_NEGATIVE}}
...
{{SUMMARY_DEMAND}}
...
{{SUMMARY_COMPETITOR}}
``` ### Technical Analysis The backfill utility treats every value in the supplied analysis JSON as trusted HTML. It performs direct string replacement without: - Checking that ratio fields are integers - Enforcing an allowed numeric range - Escaping summary text - Parsing and sanitizing the permitted `
  • ` structure - Rejecting scripts, event-handler attributes, frames, SVG content, or dangerous URLs The workflow instructs the Agent to produce summaries in HTML format, but an instruction about the expected format is not a security boundary. Analysis data can be influenced by untrusted public comments, supplied directly through `--analysis-json`, loaded ...[truncated 1928 chars]
Remediation
View remediation
100: raise ValueError("Ratio must be between 0 and 100") return value ``` 3. Escape every summary item with `html.escape()` and generate the allowed list markup internally: ```python import html def render_items(items): if not isinstance(items, list): raise ValueError("Summary items must be a list") return "
    " + "".join( f"
  • {html.escape(str(item), quote=True)}
  • " for item in items ) + "
" ``` 4. If accepting HTML is unavoidable, use a well-maintained sanitizer with a strict allowlist limited to `ul` and `li`. Remove all attributes, URLs, scripts, styles, SVG, MathML, frames, and event handlers. 5. Add a restrictive Content Security Policy to generated reports. At minimum, prohibit scripts, frames, plugins, and unexpected network connections. 6. Add regression tests using payloads containing closing tags, event handlers, `script`, `iframe`, SVG, and malicious ratio strings. Verify that they are escaped or rejected rather than executed. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/bili_comment_search.py:369
Finding

HTML Attribute Injection Through Unvalidated Cover URL Metadata

Content
View full analysis
``` ### Technical Analysis Most textual metadata fields are processed with `escape_html()`, but `cover` and `author_avatar` are inserted into the replacement map without escaping or URL validation. The `cover` value is then placed directly inside a quoted `src` attribute. If the upstream API returns a value containing a quotation mark followed by additional attributes, the value can terminate the intended `src` attribute and inject active HTML attributes. For example, a malformed value could add an image event handler that runs when the report is rendered. The data currently comes from the configured Yige API, so exploitation requires a malicious or compromised upstream response, upstream data-validation failure, or another method of supplying crafted work metadata. Nevertheless, remote API responses must be treated as untrusted input, particularly when they are written into shareable HTML files. `AUTHOR_AVATAR` is presently not used by the observed template, but retaining an unescaped replacement value creates a latent vulnerability if that placeholder is later added to an attribute context. ### Attack Path 1. A malicious, compromised, or malformed upstream API response provides a crafted `cover` field containing a quote and an injected HTML attribute. 2. `fetch_work_detail()` returns that field as `work_detail["cover"]`. 3. `generate_html_report()` assigns it directly to the `{{COVER}}` replacement without escap ...[truncated 847 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims built-in comment and sentiment analysis, but analysis appears not to be implemented locally and an undeclared third-party API at yige.zone is required via API key. Undisclosed external service dependency changes the trust boundary, potentially exposing user-supplied video identifiers, comment data, and credentials to a third party without clear disclosure or consent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims built-in comment and sentiment analysis, but analysis appears not to be implemented locally and an undeclared third-party API at yige.zone is required via API key. Undisclosed external service dependency changes the trust boundary, potentially exposing user-supplied video identifiers, comment data, and credentials to a third party without clear disclosure or consent.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · assets/report_template.html (reported line 8)May include surrounding context.

html
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>B站评论分析 - {{VIDEO_ID}}</title>

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Space+Grotesk:wght@300;400;500;600;700&display=swap" rel="stylesheet">

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · README.en.md (reported line 7)May include surrounding context.

md
## Overview

Enter any Bilibili video link or BV ID to **instantly retrieve comment data**. AI automatically performs four-dimension sentiment analysis (positive / negative / demand / competitor) and generates an interactive HTML report for offline saving.

**Feature Overview**

Unbounded Output

Medium
Category
Output Handling
Confidence
78% confidence
Finding

Advertising a "full comment table — no truncation" creates risk of unbounded output, especially when comments are numerous or individually long. In an agent setting this can lead to excessive token/file size, degraded performance, accidental overexposure of user-generated content, and oversized HTML artifacts.

Content

Scanner excerpt · README.en.md (reported line 40)May include surrounding context.

md
### Highlights

- **Bilibili meme culture understanding**: Recognizes awsl / yyds / xswl / 爷青回 / 下次一定 and other barrage slang in their real context
- **Complete data display**: Work details (views / likes / coins / favorites / danmaku, etc.) and full comment table — no truncation
- **Encoding-safe backfill**: Intelligent encoding ensures Chinese analysis content is injected into reports without corruption

---

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README says users can 'Simply describe your video in natural language — no fixed commands to memorize,' which does not clearly define what inputs invoke the skill versus ordinary conversation. This broad trigger description lacks negative examples or scope constraints, increasing the chance of unintended activation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Using generic confirmations like "Yes" as a trigger for HTML report generation is risky because such phrases commonly appear in normal conversation and can accidentally invoke the skill or continue a prior workflow without clear user intent. In an agent environment, overly vague follow-up triggers can cause unintended data processing or file generation based on stale context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly says users can invoke it with unrestricted natural language and '无需记忆固定命令', which makes activation boundaries broad and ambiguous. In an agent environment, this increases the chance of accidental or context-driven invocation on unrelated user input, potentially causing unintentional external API use, data retrieval, or report generation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example trigger phrases include very generic terms such as '需要' and '生成HTML', which are common in ordinary conversation and not uniquely tied to this skill. In a multi-skill agent, such generic triggers can cause incorrect routing or unintended continuation of prior state, leading to accidental report generation or processing of the wrong target video.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises capabilities that imply access to environment variables, local files, file writes, and network resources, but it does not declare any explicit tool scope or permissions boundaries. This creates an overbroad execution surface where an agent may grant more access than users expect, increasing the risk of unintended data exposure, unsafe file modification, or unauthorized outbound requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases include broad everyday expressions like '评论分析', '看评论', and 'bilibili评论', which can overlap with ordinary conversation and cause accidental invocation. Unintended activation is risky because it may initiate network requests, consume API quota, or process user content without a deliberate request to run the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The usage guidance says users can invoke the skill with any natural-language video link or BV number, but it does not define clear activation boundaries or when the agent should ask for confirmation. In an agent setting, this ambiguity increases the chance that pasted links or casual references trigger external API calls or file generation unintentionally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The HTML root explicitly sets lang="zh-CN", and the visible interface text throughout the template is Chinese-only. This indicates a fixed language/locale choice without user opt-in, which matches the language-policy violation criteria for natural-language policy issues.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions, prompts, and required user-facing text are all specified in Chinese, including mandatory output phrases. This can impose a language constraint on users without opt-in, and the file does not document that the skill is intentionally limited to Chinese-speaking users or a China-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module docstring, CLI argument descriptions, and runtime messages are all written in Chinese, which imposes a specific language on users. The file does not offer any language/locale selection or explain that the tool is intended only for a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script transmits user-supplied Bilibili video identifiers and receives/stores associated comment metadata through third-party APIs at yige.zone, but the skill description does not clearly disclose this external data flow. Even though the data is largely public platform data, users may not expect their queried targets, API key usage, and generated reports containing commenter metadata (UID, nickname, IP属地) to be sent to and processed by a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

These lines direct the agent to open the HTML report via Start-Process or open, which triggers an action on the user's system. Although the workflow asks for confirmation before generating the report, it does not explicitly disclose that the file will then be automatically opened in the user's default browser/application.

Content

No source excerpt is available for this finding.