Back to skill

Security audit

Html Report Generator

Security checks for vulnerabilities and agentic risk

Overview

This skill can turn user data into a public HTML report link without clear confirmation or safety checks.

Review this skill carefully before installing. It should be used only when users intentionally want to publish a generated HTML report, and it should require confirmation before deployment plus clear sanitization rules for untrusted data.

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
SKILL.md:17
Finding

Unsanitized User Input in Generated and Deployed HTML

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 17-21, 138-142, and 172-179
Vulnerability Type: Stored cross-site scripting through unsafe HTML generation
Risk Level: High

Vulnerable Code Snippets

markdown
读取用户提供的数据(文字/表格/JSON),确定:
- 有哪些指标/字段
- 数据类型(数值/文本/时间序列)
- 适合的图表类型
html
<title>{报告标题}</title>
<style>
html
<body>
  {内容区}
</body>
</html>
bash
# 保存HTML
write /workspace/{project}/index.html

# 部署
deploy --dist_dir /workspace/{project} --project_name {项目名}

Technical Analysis

The documented workflow accepts arbitrary user-provided text, tables, or JSON and interpolates generated content into an HTML template. In particular, the report title is inserted into the title element and the report body is inserted into {内容区}. The resulting file is then deployed.

The instructions do not require contextual HTML encoding, markup sanitization, safe DOM construction, URL-scheme validation, or a Content Security Policy. If attacker-controlled fields are copied into the template as HTML, they can break out of their intended context and introduce active content such as script elements, inline event handlers, dangerous URL schemes, or deceptive forms.

This is a stored cross-site scripting risk because the malicious input may be embedded in the generated report, persisted in the deployed HTML file, and executed whenever another user visits the deployment.

Attack Path

  1. An attacker supplies report data containing an HTML payload, for example:
    html
    <img src="x" onerror="alert(document.domain)">
    
  2. The Skill processes the value as report content without a documented escaping or sanitization step.
  3. The payload is inserted into {内容区} or another generated HTML context.
  4. The generated document is written to /workspace/{project}/index.html.
  5. The project directory is deployed and a public or shared link is re ...[truncated 1261 chars]
Remediation
View remediation

Remediation Suggestions

  1. Treat every value derived from user-provided text, tables, and JSON as untrusted.
  2. HTML-encode plain-text values according to their output context, including element text, attribute values, URLs, CSS, and JavaScript contexts. Avoid implementing contextual escaping through ad hoc string replacement.
  3. Construct the report from fixed templates and text-only placeholders. Use safe DOM APIs such as textContent rather than innerHTML when client-side rendering is required.
  4. If limited rich text is necessary, sanitize it with a maintained HTML sanitizer and a strict allowlist. Disallow at minimum:
    • script, iframe, object, embed, form, and base elements.
    • Inline event attributes such as onerror and onclick.
    • javascript:, unsafe data:, and other executable URL schemes.
    • Untrusted inline styles or SVG content unless separately sanitized.
  5. Validate generated links and permit only explicitly approved schemes such as https:.
  6. Apply a restrictive Content Security Policy, for example one that blocks inline scripts, plugins, framing, and unauthorized external connections. Use nonces or hashes if scripts are required.
  7. Deploy each generated report on an origin isolated from authenticated or sensitive applications. Do not expose privileged cookies to the report origin.
  8. Add adversarial tests covering closing tags, event handlers, malformed markup, SVG payloads, encoded URL schemes, and injections into title, body, attribute, and style contexts.
  9. Preview the sanitized output and require explicit confirmation before public deployment.
  10. Document the sanitization and encoding requirements directly in the Skill's generation workflow so they cannot be omitted by an implementation.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match ordinary requests like making a webpage or report, which increases the chance the skill activates when the user did not intend file creation or deployment. In this skill, overbroad activation is more dangerous because activation can lead to writing artifacts and publishing content externally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description advertises report generation but omits that it writes files and deploys generated content, preventing informed user consent. This is especially risky because arbitrary input may contain confidential, regulated, or proprietary information that could be published through the deployment step.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The invocation example uses a natural, everyday request that many users could say without realizing it invokes a workflow with filesystem writes and deployment. This ambiguity increases the risk of unintended execution and accidental publication of user-provided data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a simple HTML report generator, but its documented behavior writes files, deploys the generated site, and returns a live link. That expands the capability from local content generation to publication of untrusted user input, which can expose sensitive data, enable hosting of malicious HTML/JS content, and create unintended external sharing.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Including a deployment step in a report-generation skill is a capability escalation beyond the stated purpose and is not justified by the core use case. Because the HTML is generated from arbitrary user data, automatic deployment can turn the tool into a vehicle for publishing deceptive pages, data leaks, or script-bearing content under a hosted link.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The HTML template hard-codes <html lang="zh">, which enforces a specific language/locale regardless of the user’s preferences or report audience. The file does not offer a language choice or explain why a Chinese locale is required for this skill.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.