Back to skill

Security audit

微信小程序开发辅助决策助手

Security checks for vulnerabilities and agentic risk

Overview

The skill’s stated purpose is coherent, but its HTML report generator places untrusted research and user-supplied text directly into generated reports, which can make a report unsafe to open.

Review before installing. The workflow is understandable and not deceptive, but generated HTML reports should not be opened or shared with untrusted content until the renderer escapes or sanitizes all fields and ideally adds a restrictive Content Security Policy. Keep report output paths explicit and avoid giving the skill broader edit authority than necessary.

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

Error
Location
scripts/report_generator.py:112
Finding

Stored HTML Injection in Generated Reports

Content
View full analysis
小程序可行性决策报告 - {name} ``` They are also rendered directly in the document body: ```python

📱 {name}

{direction}
微信小程序开发可行性决策报告 · {now}
``` The same unsafe interpolation pattern is applied to numerous other externally supplied report fields, including research details, keywords, competitor data, business-model descriptions, promotion strategies, development guidance, and risk descriptions. Representative examples include: ```python

{wx_detail}

``` ```python {safe_get(c, 'name', '未知')} {safe_get(c, 'feature', '-')} {safe_get(c, 'users', '-')} ``` ```python

{bm_detail}

``` ```python 策略{['一','二','三','四','五','六'][i] if i < 6 else i+1}:{safe_get(st, 'title', '')}

{safe_get(st, 'desc', '')}

``` ```python {safe_get(risk, 'name', '')}

{safe_get(risk, 'desc', '')}

``` ### Technical Analysis `safe_get()` only checks whether a value is stored in a dictionary. It does not perform HTML escaping, validation, or sanitization. Consequently, `generate_report()` treats product details, command-line JSON input, and web- ...[truncated 2614 chars]
Remediation
View remediation
str: return escape(str(value), quote=True) ``` Apply this function to all scalar values, list entries, and nested dictionary fields rendered in the report: ```python name = escape_text(safe_get(data, "name", "Unnamed product")) direction = escape_text(safe_get(data, "direction", "Unspecified direction")) wx_detail = escape_text(safe_get(wechat_index, "detail", "No detailed data")) ``` 2. Replace manual f-string templating with an autoescaping template engine. For example, use Jinja2 with HTML autoescaping explicitly enabled: ```python from jinja2 import Environment, FileSystemLoader, select_autoescape env = Environment( loader=FileSystemLoader("templates"), autoescape=select_autoescape(["html", "xml"]), ) ``` 3. Keep numeric and presentation values separate from text: - Require scores to be finite integers or floats within the range `0` to `100`. - Validate counts, colors, trend values, and risk levels against strict allowlists. - Do not place arbitrary input into CSS properties or other executable browser contexts. 4. If selected fields must support formatting, sanitize them with a mature HTML sanitizer using a minimal allowlist. Disallow scripts, event-handler attributes, forms, iframes, SVG, embedded objects, external styles, and dangerous URL schemes. 5. Add a restrictive Content Security Policy to generated reports as defense in depth. For a self-contained report, avoid inline JavaScript and block unnecessary outbound communication: ```html ``` A CSP is supplementary protection and must not replace contextual output escaping. 6. Add regression ...[truncated 466 chars]
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 (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill requests powerful tools including Write, Edit, and Bash, and it explicitly instructs generating and writing an HTML report, but it does not declare a restrictive tool scope such as permissions or allowed-tools. This creates an over-privileged execution surface where the agent may write files more broadly than intended, increasing the risk of unintended file modification or abuse if user-controlled content is incorporated into file paths or generated output.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The example triggers include broad natural-language requests such as '帮我评估做AI写作小程序可行吗', which can overlap with ordinary conversation and cause the skill to activate outside a clearly bounded intent. Over-broad activation can unexpectedly grant the skill access to its higher-risk toolchain, including web access and file-writing behavior, in contexts where the user may not have intended to invoke it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The generated report sets the document language to zh-CN, which forces a specific locale in the output. Under the policy, locale constraints should either be optional for the user or clearly documented as a justified region-specific limitation; this code does not present any user choice or explicit justification in the interface.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated report states '数据来源:公开信息搜索', which implies the generator itself sourced or searched public data. In this file, the code only accepts JSON inputs from CLI arguments and renders them into an HTML report; there is no search, crawling, or retrieval logic. This is a documentation/representation mismatch in the output content itself.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.