Back to skill

Security audit

B站 (bilibili) 热门视频监控

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned, but it needs review because it asks for and stores reusable Bilibili cookies, an OpenRouter key, and SMTP credentials in plaintext while sending video subtitle content to external services.

Install only if you are comfortable giving the skill Bilibili session cookies, optional OpenRouter API access, and SMTP sending authority. Prefer environment variables or a secret manager over the generated plaintext config, avoid command-line secrets, use an app-specific email password, review recipients before sending, and assume subtitles/titles/metadata may be shared with OpenRouter and email recipients.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:86
Finding

Plaintext Storage of Account and Service Credentials

Content
View full analysis
{baseDir}/bilibili-monitor.json << 'EOF' { "bilibili": { "cookies": "COOKIES值" }, "ai": { "openrouter_key": "OPENROUTER_KEY值或空", "model": "MODEL值" }, "email": { "smtp_email": "SMTP_EMAIL值", "smtp_password": "SMTP_PASSWORD值", "recipients": ["收件人1", "收件人2"] }, "report": {"num_videos": 10} } EOF ``` ### Technical Analysis The Skill initialization procedure writes a complete Bilibili cookie string, an OpenRouter API key, and a Gmail application password into an ordinary JSON file. The command does not establish owner-only file permissions, encrypt the secrets, or use a protected operating-system credential store. Excluding `bilibili-monitor.json` through `.gitignore` only helps prevent an accidental Git commit. It does not protect the credentials from other local users, insecure backups, directory sharing, endpoint malware, or a process that can read the project directory. This behavior also conflicts with the safer guidance in `README.md:64-82`, which states that sensitive credentials should be passed through environment variables rather than stored in the configuration file. ### Attack Path 1. A user follows the Skill initialization procedure. 2. The Skill creates `bilibili-monitor.json` containing reusable credentials in plaintext. 3. Another local account, backup reader, synchronization service, or compromised process obtains read access to the project directory. 4. The attacker reads the JSON file and extracts the Bilibili cookies, OpenRouter API key, and Gmail application password. 5. The attacker reuses the credentials against their corresponding services until the credentials expire or are revoked. ### Impact Assessment Exposure of the configuration file may allow: - Impersonation of the user's active Bilibili session within the ...[truncated 562 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
generate_report.py:679
Finding

Sensitive Credentials Exposed Through Command-Line Arguments

Content
View full analysis
= 1.0 避免触发B站速率限制") parser.add_argument("--output", "-o", help="输出文件路径") # AI 点评相关参数 parser.add_argument("--openrouter-key", default="", help="OpenRouter API Key(用于生成 AI 点评)") ``` The email script exposes the same pattern: ```python parser.add_argument("--smtp-email", help="发件人邮箱") parser.add_argument("--smtp-password", help="邮箱密码") ``` The README explicitly recommends secret-bearing command-line arguments: ```bash python generate_report.py --cookies "你的cookies" --openrouter-key "你的key" --config bilibili-monitor.json --output report.md ``` ### Technical Analysis Command-line arguments are not an appropriate transport for reusable credentials. Depending on the operating system and execution environment, arguments can be exposed through: - Process listings and process inspection interfaces. - Shell command history. - Terminal session recording. - CI/CD logs and job metadata. - Endpoint monitoring or observability agents. - Diagnostic reports and command auditing systems. Although some operating systems restrict process inspection between users, shell history and automation logs remain practical disclosure paths. The risk is increased because the project documentation presents ...[truncated 1141 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
send_email.py:74
Finding

HTML Injection Through Unescaped Report Content

Content
View full analysis
') num, title = match.groups() html_parts.append(f'
') html_parts.append(f'
{num}{title}
') in_video_block = True continue ``` Other affected output paths similarly interpolate content without HTML escaping: ```python if stripped.startswith('>'): content = stripped[1:].strip() if len(stripped) > 1 else '' content = re.sub(r'\*\*(.+?)\*\*', r'\1', content) content = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'\1', content) if html_parts and html_parts[-1].startswith('
') and not html_parts[-1].endswith('
'): html_parts[-1] += f'
{content}' elif html_parts and html_parts[-1].endswith('
') and '
' in html_parts[-1]: html_parts[-1] = html_parts[-1][:-6] + f'
{content}
' else: html_parts.append(f'
{content}
') continue ``` ```python processed_cells = [] for c in cells: c = re.sub(r'\[([^\]]+)\]\(([^)]+)\)', r'\1', c) c = re.sub(r'\*\*(.+?)\*\*', r'\1', c) processed_cells.append(c) if is_header: row_html = ''.join(f'{c}' for c in processed_cells) else: row_html = ''.join(f'{c}' for c in processed_cells) ``` ### Technical Analysis The Markdown-to-HTML converter inserts report text directly into HTML elements without applying `html.escape()` or an equivalent context-aware encoding operation. The report ...[truncated 2175 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (38)

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 16)May include surrounding context.

text
!example_report.md

# 包含敏感信息的文件
.env
*.env
config.json
bilibili-monitor.json

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 17)May include surrounding context.

text
!example_report.md

# 包含敏感信息的文件
.env
*.env
config.json
bilibili-monitor.json

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill introduces undisclosed third-party data transfer by sending subtitle-derived content to OpenRouter models, while also collecting SMTP credentials for outbound email. This combination of hidden external processing plus local storage of multiple secrets creates a meaningful security and privacy risk because users may not realize their data and credentials are being handled across several separate services.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill introduces undisclosed third-party data transfer by sending subtitle-derived content to OpenRouter models, while also collecting SMTP credentials for outbound email. This combination of hidden external processing plus local storage of multiple secrets creates a meaningful security and privacy risk because users may not realize their data and credentials are being handled across several separate services.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill introduces undisclosed third-party data transfer by sending subtitle-derived content to OpenRouter models, while also collecting SMTP credentials for outbound email. This combination of hidden external processing plus local storage of multiple secrets creates a meaningful security and privacy risk because users may not realize their data and credentials are being handled across several separate services.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file’s behavior materially diverges from the declared skill purpose. Instead of generating a Bilibili hot-video daily report and sending email, it retrieves and prints subtitles for arbitrary videos, which is a scope mismatch that can conceal undeclared data access and make users or reviewers authorize capabilities they did not intend. In the skill context, this increases risk because the code introduces unrelated content access functionality without a clear business need.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

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

Content

Scanner excerpt · example_report.md (reported line 233)May include surrounding context.

md
> 播放 7.4万 | 点赞 4213 | 收藏 2028 | 硬币 2002 | 弹幕 430 | 评论 242 | 分享 241

**📝 视频简介**:
> 文案:秃秃 文案协助:@菲林的解码日记  文案解读彩蛋:@录音系何某人_Grace  @小鱼陪拉片  @辣椒梦话  参考资料来源: (传媒论坛 《闪灵》音效于人物塑造和受众效果的影响 李敬平) (文献 汤舜杰.斯坦利·库布里克电影的空间叙事研究 南京艺术学) (文献 孙潘,周荣.女性主义地理学视角下《闪灵》中的女性空间) (钱江晚报) 闪灵30号首次在内地上映 这是我们作为影视UP狂喜的一件事 之前秃秃还转发朋友菲林的闪灵拉片 结果非常可惜 菲林闪灵第一期内容没几天就被下

**🤖 B站官方AI总结**:
> (该视频暂无官方AI总结)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README states that video subtitles are sent to an external LLM service (OpenRouter and downstream models) for summarization, but it does not provide a clear, prominent warning that third-party data sharing occurs. Users may unknowingly transmit copyrighted, private, or sensitive content from subtitles and metadata to external providers, creating privacy, compliance, and data-governance risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are very generic (for example, '热门视频' and '视频日报') and can easily match ordinary user requests that are not intended to invoke this skill. In an agent environment, this can cause unintended activation, leading to network access, credential use, external API calls, and email/report generation without sufficiently explicit user intent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill requests and uses sensitive capabilities including local file writes, network access, and credential handling, but it does not declare any explicit tool scope or permissions boundaries. This increases the chance of over-broad execution and makes it harder for users or the platform to understand that the skill will store cookies, API keys, and email credentials locally and send data to external services.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger phrases are broad and generic, increasing the likelihood that the skill activates during ordinary conversation about Bilibili or hot videos. Because activation can lead to credential collection and execution of networked scripts, accidental invocation raises the chance of social-engineering-style prompting for sensitive cookies, API keys, and email passwords.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file implements capabilities beyond the declared skill scope: arbitrary video detail lookup, AI summary retrieval, and subtitle extraction for any provided BVID. In an agent-skill context, scope expansion matters because it increases the amount and types of external data the skill can fetch and process, creating unreviewed functionality that could be abused for unintended collection or prompt-input expansion.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI accepts sensitive Bilibili cookies and immediately uses them for outbound requests without prominent disclosure, storage guidance, or safeguards. In an agent ecosystem, this can lead operators to paste account credentials into an insufficiently trusted tool, increasing the risk of credential misuse, accidental logging, or unauthorized account access if the environment is compromised.

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 · bilibili_api.py (reported line 83)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

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 · bilibili_api.py (reported line 130)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

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 · bilibili_api.py (reported line 151)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

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 · bilibili_api.py (reported line 191)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

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 · bilibili_api.py (reported line 226)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

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 · bilibili_subtitle.py (reported line 42)May include surrounding context.

python
def get_video_info(bvid: str) -> dict:
    """获取视频信息,包括aid和cid"""
    url = f"https://api.bilibili.com/x/web-interface/view?bvid={bvid}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
        "Referer": "https://www.bilibili.com"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code explicitly solicits and transmits a user’s Bilibili SESSDATA cookie to access subtitles, even though that credential is unrelated to the declared daily-report/email purpose. SESSDATA is a login bearer token; collecting it creates account-compromise risk if mishandled, logged, reused, or exposed, and the mismatch in declared purpose makes the request especially suspicious in this skill context.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

This outbound request sends the user’s SESSDATA cookie to Bilibili when fetching subtitle information. While contacting Bilibili is expected for the function, transmitting an account credential for an undeclared capability increases the security impact: exposure through misuse, debugging, wrapper tooling, or future code changes could compromise the user’s session.

Content

Scanner excerpt · bilibili_subtitle.py (reported line 59)May include surrounding context.

python
def get_subtitle_info(aid: int, cid: int, sessdata: str = "") -> list:
    """获取字幕信息"""
    url = f"https://api.bilibili.com/x/player/wbi/v2?aid={aid}&cid={cid}"

    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code comment and selection logic state that it will download the first subtitle and explicitly prefer Chinese subtitles, choosing entries where the language contains "zh" or "ai-zh". This imposes a language preference automatically rather than offering the user a locale choice or requiring opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description suggests generating a Bilibili daily report, but this file also transmits video subtitles and metadata to OpenRouter, a third-party AI service. That creates a data-sharing/privacy issue because user-visible behavior does not clearly disclose that subtitle contents and related metadata leave the local environment for external processing.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This code makes an external network request to OpenRouter and includes an authorization bearer token plus prompt data derived from video content. External transmission is expected for an LLM-backed feature, but in this skill context it is security-relevant because subtitles and metadata are sent off-platform and may not be obvious to users.

Content

Scanner excerpt · generate_report.py (reported line 47)May include surrounding context.

python
"""
    for attempt in range(max_retries):
        try:
            response = requests.post(
                "https://openrouter.ai/api/v1/chat/completions",
                headers={
                    "Authorization": f"Bearer {api_key}",

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This code makes an external network request to OpenRouter and includes an authorization bearer token plus prompt data derived from video content. External transmission is expected for an LLM-backed feature, but in this skill context it is security-relevant because subtitles and metadata are sent off-platform and may not be obvious to users.

Content

Scanner excerpt · generate_report.py (reported line 47)May include surrounding context.

python
"""
    for attempt in range(max_retries):
        try:
            response = requests.post(
                "https://openrouter.ai/api/v1/chat/completions",
                headers={
                    "Authorization": f"Bearer {api_key}",

Static analysis

No suspicious patterns detected.