Back to skill

Security audit

自动视频工具工作流

Security checks for vulnerabilities and agentic risk

Overview

This skill matches a Bilibili news-video automation workflow, but it needs Review because it can act through logged-in browser sessions, publish immediately, and fetches news with TLS verification disabled.

Install only if you are comfortable with an agent operating your logged-in Huasheng and Bilibili browser sessions. Require a manual review and explicit confirmation before any Bilibili submission, avoid unattended cron publishing, and fix the disabled TLS verification before relying on fetched news content.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_news.py:20
Finding

Global TLS Certificate and Hostname Verification Disabled

Content
View full analysis

Vulnerability Details

File Location: scripts/fetch_news.py, lines 20–22 and 41
Vulnerability Type: Improper TLS certificate validation
Risk Level: Medium

Vulnerable Code

python
# Ignore SSL certificates for some news sources
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

The insecure context is then used for every outbound request:

python
def http_get(url, timeout=15):
    req = urllib.request.Request(url, headers={"User-Agent": UA})
    with urllib.request.urlopen(req, timeout=timeout, context=ctx) as resp:
        return resp.read().decode("utf-8", errors="ignore")

Technical Analysis

The script creates a global TLS context that disables both certificate-chain verification and hostname validation. Although all configured sources use HTTPS, passing this context to urlopen removes HTTPS server-authentication guarantees.

An attacker able to intercept or redirect network traffic can present an arbitrary certificate without causing the connection to fail. The attacker can then impersonate a configured news service and return manipulated JSON or HTML. The script treats the response as trusted input, extracts news titles and URLs, stores them in SQLite, and incorporates titles into generated narration.

The flaw applies to every request made through http_get, not merely to a single source with a known certificate problem.

Attack Path

  1. The victim runs scripts/fetch_news.py on an attacker-influenced network, or an attacker compromises DNS, routing, or a network gateway.
  2. The script initiates an HTTPS request to a configured news source.
  3. The attacker intercepts the request and supplies an arbitrary TLS certificate.
  4. Because certificate and hostname verification are disabled, the client accepts the attacker's endpoint.
  5. The attacker returns crafted news JSON or HTML containing manipulated titles and links.
  6. The script parses and stores that content in `ne ...[truncated 873 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the global insecure TLS configuration and rely on Python's default verified HTTPS behavior:
python
def http_get(url, timeout=15):
    req = urllib.request.Request(url, headers={"User-Agent": UA})
    with urllib.request.urlopen(req, timeout=timeout) as resp:
        return resp.read().decode("utf-8", errors="ignore")
  1. If an explicit context is required, preserve certificate and hostname validation:
python
ctx = ssl.create_default_context()

def http_get(url, timeout=15):
    req = urllib.request.Request(url, headers={"User-Agent": UA})
    with urllib.request.urlopen(req, timeout=timeout, context=ctx) as resp:
        return resp.read().decode("utf-8", errors="ignore")
  1. If a particular source has certificate failures, repair or replace that source rather than disabling verification globally. Where a private certificate authority is legitimately required, load only that trusted CA using cafile or load_verify_locations.

  2. Add automated tests that verify requests fail for expired, self-signed, hostname-mismatched, and otherwise untrusted certificates.

  3. Validate fetched content before it enters the publication pipeline. Enforce expected response types and schemas, reject unexpected link schemes or hosts where appropriate, and require human approval before externally publishing generated material.

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
96% confidence
Finding

声明描述的是端到端自动视频生产与发布流程,但当前代码块实际只覆盖了前半段的数据采集与文案整理:从若干新闻源抓取新闻、简单模板化生成口播文案、使用 news_db 做去重存储,并输出 JSON 摘要和合并口播文本。代码中没有任何与视频生成服务、B站接口/自动化、封面处理、浏览器表单控制或上传发布相关的实现。因此,描述显著超出了该代码块实际行为,构成明显不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents an end-to-end automated video production and publishing workflow. The supplied code chunk does not perform those actions; it is a supporting persistence module for storing and deduplicating news items in a local SQLite database. While such storage could support a news/video pipeline, the actual behavior of this chunk is materially narrower and different from the declared purpose. It also introduces database/file-system access that is not mentioned in the description. Therefore this code chunk does not accurately represent the declared skill behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill describes capabilities that involve network access, local file/media handling, and database writes, but it does not declare any explicit tool scope or permission boundaries. In an automation skill that posts content and manipulates browser state, missing scope declarations increase the risk of over-broad tool use and make it harder to constrain accidental or unauthorized actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Broad trigger conditions can cause the skill to activate for ordinary requests related to news or video publishing, leading to unintended automation in a browser and downstream posting actions. In this context, the skill is especially sensitive because it can manipulate third-party sites and potentially publish content, so ambiguous invocation increases operational risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The workflow explicitly includes immediate submission to Bilibili but does not warn the user about account-impacting actions or require explicit confirmation before posting. This is dangerous because accidental activation could publish unwanted content, affect a real user account, and create reputational or policy consequences on an external platform.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Natural-language strings and the module purpose specify Chinese news collection and Chinese narration generation as a fixed behavior. The file does not provide an opt-in, configuration switch, or documented regional constraint to justify forcing a specific language/locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script explicitly disables TLS certificate validation and hostname checking for all outbound HTTPS requests. This allows man-in-the-middle interception or response tampering, so an attacker on the network path could inject fake news content or malicious links that would be ingested into the downstream automation pipeline.

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

python
NEWS_SOURCES = {
    "国内": [
        # 澎湃新闻国内 (JSON)
        {"name": "澎湃", "url": "https://api.thepaper.cn/contentapi/wwwIndex/rightSidebar", "type": "json"},
        # 新浪国内新闻 (HTML RSS-like)
        {"name": "新浪", "url": "https://feed.mix.sina.com.cn/api/roll/get?pageid=153&lid=2516&k=&num=20&page=1", "type": "json"},
    ],

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This markdown file gives step-by-step instructions to write directly into a hidden textarea and dispatch an input event, which changes the content shown on the Fabric.js canvas. The document does not include any warning that this operation edits user-visible content or may overwrite existing template text.

Content

No source excerpt is available for this finding.