Back to skill

Security audit

微信文章格式转换

Security checks for vulnerabilities and agentic risk

Overview

This WeChat article exporter mostly matches its stated purpose, but its HTML export can fetch attacker-controlled resource URLs and preserve active HTML content, creating review-worthy security risk.

Install only if you are comfortable reviewing or constraining its HTML export behavior. Prefer Markdown/Text/JSON for lower risk, and avoid exporting untrusted WeChat articles to HTML until asset URL allowlisting and stronger HTML sanitization are added.

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

Error
Location
scripts/fetch_article.py:210
Finding

Server-Side Request Forgery Through Article-Controlled Resource URLs

Content
View full analysis
bytes: hdrs = dict(headers or {}) hdrs["User-Agent"] = USER_AGENT hdrs["Referer"] = "https://mp.weixin.qq.com/" for attempt in range(2): try: req = urllib.request.Request(url, headers=hdrs) with urllib.request.urlopen(req, timeout=timeout) as resp: data = resp.read() return data[:2 * 1024 * 1024] except Exception: if attempt == 0: time.sleep(0.5) return b"" ``` ### Technical Analysis The initial article URL is validated as belonging to `mp.weixin.qq.com`, but that restriction is not applied to resource URLs extracted from the downloaded article. Stylesheets, images, and CSS background URLs are resolved and submitted to `_parallel_download()`, which ultimately calls `urllib.request.urlopen()`. There is no validation of: - The resource URL scheme. - The destination hostname. - Resolved IPv4 or IPv6 addresses. - Loopback, private, link-local, reserved, or cloud metadata address ranges. - Redirect destinations. - Whether the destination belon ...[truncated 2128 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_article.py:308
Finding

Active Content Survives HTML Export Sanitization

Content
View full analysis
{title} {chr(10).join(local_css_links)} {MINIMAL_CSS} {article_html} ''' ``` ### Technical Analysis The exporter serializes `#js_article_bottom_bar` into ...[truncated 2647 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs use of network access and local file writes, but it does not declare an explicit tool scope such as permissions or allowed-tools. That creates a governance gap: an agent may be able to fetch remote content and write files without clear authorization boundaries, making unintended data access or filesystem side effects harder to constrain and audit.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger conditions include broad natural-language requests like converting or saving an article, which can cause the skill to activate when the user did not clearly intend to invoke this specific capability. Because the skill performs network retrieval and local file creation, accidental invocation can lead to unintended external requests and local persistence of fetched content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The repeated invocation examples remain ambiguous and do not specify clear exclusions, increasing the chance of the skill being selected in contexts where the user only mentions an article casually. In this skill, misrouting is more dangerous than in a read-only skill because it can trigger downloads, process multiple links, and write artifacts to the desktop.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code’s docstring and all user-facing CLI messages are presented only in Chinese, which imposes a specific language on users without any opt-in or documented locale constraint. The policy explicitly flags language or locale requirements unless the skill offers a choice or clearly justifies a region-specific limitation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes grabbing and converting WeChat articles into output formats, which is satisfied by fetching page content and transforming it. This code goes beyond conversion by extracting and returning read-count metadata through an additional API call, adding analytics-style behavior not reflected in the stated skill description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code creates directories and writes HTML plus downloaded asset files to the local filesystem, but the function itself provides no user-facing disclosure about these file-write side effects. Under the code-file criteria, file writes should be flagged when there is no confirmation prompt and no local explanatory comment or docstring warning users about the behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generated output forces a specific locale via <html lang="zh_CN">, which is a natural-language locale policy choice embedded in code. The file does not offer user opt-in or explain why all outputs must be fixed to Chinese locale, so this meets the policy-violation criterion.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest emphasizes article capture and conversion into Markdown/HTML/Text/JSON/Excel. The code returns a richer metadata record including author, cover URL, summary, topic, originality, read count, and comment count, which expands the behavior beyond simple conversion and storage.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.