Back to skill

Security audit

book-toolbook-html

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated HTML card-book purpose, but generated pages can include unsafe injected browser content if untrusted JSON is used.

Install only if you control and review the JSON inputs and are comfortable with Chinese-only templates, a default promotional back cover, browser localStorage for display preferences, and a remote Unsplash cover image request. Do not use it on untrusted JSON or publish generated HTML under a trusted web origin until the attribute-escaping bug is fixed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Note
Location
assets/card-book-template.themed.html:487
Finding

Default Templates Inject Promotional and Audience-Acquisition Content into Generated Deliverables

Content
View full analysis
关注公众号 {{公众号名}},回复关键词 {{【关键词】}} 获取:
· 本卡片书的可打印 PDF 版(A6 裁切,随身带)
· 读者社群入口,一起把经典方法论用起来
关键词:{{关键词}}
※ 以上公众号名、关键词与引流话术为占位示例,请按你实际的运营账号与私域入口替换。
``` An equivalent block is present in the basic template. The Skill documentation also directs the operator to provide an account name and response keyword and describes the back cover as containing lead-generation content. ### Technical Analysis The card-book generator always retains the back-cover promotional block. The generated deliverable therefore includes instructions to follow a configured public account, submit a keyword, obtain a PDF, and join a community, even when the underlying user request is only to generate a card-book HTML document. Although the destination values are supplied through the input JSON rather than hardcoded to an attacker-controlled account, this behavior changes the scope of an ordinary document-generation task by introducing an audience-acquisition funnel into every output by default. The promotional behavior is not controlled by an explicit opt-in flag. This finding does not provide operating-system privileges, execute arbitrary code, or access confidential information. Its security relevance is limited to persistent output manipulation and the potential for social-engineering content to be distributed through generated artifacts. ### Attack Path 1. A user or agent loads the Skill to generate a card-book document. 2. The workflow re ...[truncated 974 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/build_card_book.py:26
Finding

Incomplete HTML Escaping Allows Attribute and Markup Injection through the Book Title

Content
View full analysis
``` The basic template contains the equivalent sink: ```html ``` ### Technical Analysis `html.escape(..., quote=False)` escapes characters such as `<`, `>`, and `&`, but deliberately leaves single and double quotation marks unchanged. This is suitable only for some HTML text-node contexts. It is unsafe when the resulting value is placed inside a quoted HTML attribute. Because `{{书名}}` is inserted into the double-quoted `content` attribute, an attacker-controlled double quote can terminate the attribute. The attacker can then inject additional attributes or close the element and introduce new markup. A representative malicious JSON value is: ```json { "书名": "\">
Remediation
View remediation
Vulnerability Patterns
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 25)May include surrounding context.

md
| `assets/card-book-template.themed.html` | themed 模板(深色 ☀/🌙 + 5 色板,默认用这个) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

md
| `assets/card-book-template.html` | 基础模板(米色纸浅色单主题) |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill describes and directs use of local scripts that read and write files (build_card_book.py, check_card_book.py) but does not declare any tool scope or permissions boundary. In an agent environment, undeclared file capabilities can cause the skill to be invoked without adequate user visibility or policy gating, increasing the risk of unintended file access or modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description is entirely written around Chinese-language output and content conventions, including Chinese examples and guidance such as citing Chinese quotations. There is no statement that the user can choose another language, nor a documented reason that the skill is limited to Chinese-only use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The invocation text is broad enough to match common requests like making notes, webpages, or toolbooks, which can cause the skill to activate in situations the user did not specifically intend. Over-broad triggering can route unrelated content into a file-generating workflow, increasing the chance of unwanted file creation, confusing outputs, or accidental execution of associated build steps.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The HTML root sets lang="zh-CN", which establishes a fixed Simplified Chinese locale for the document. Under the policy rules, forcing a specific language/locale without opt-in or a documented region-specific justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template claims to be a single-file/offline-friendly artifact with no external dependencies, yet it fetches a remote Unsplash image for the cover. This creates a privacy and integrity dependency on a third party: opening the HTML can leak reader IP/user-agent/referrer and the rendered content can change or fail based on network availability or upstream content changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document root sets lang="zh-CN", and the template content is consistently Chinese-only, which imposes a specific language/locale by default. There is no indication that this locale restriction is optional, user-selected, or justified as a region-specific skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The template claims to be a single-file/offline-friendly asset, but the cover includes a hard-coded remote Unsplash image. This causes unsolicited outbound network requests, leaks user metadata such as IP address and user agent to a third party, and breaks strict offline/self-contained expectations; however, in this context it is primarily a privacy/integrity issue rather than a direct code-execution vulnerability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON file presents all user-facing content exclusively in Chinese, including title, subtitle, introduction, and overview, with no indication that the user can choose another language or that the content is region-specific. Under the language/locale policy rule, forcing a single language without documented opt-in or justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file contains natural-language instructions that require the generated artifact to use Chinese content and Chinese typographic conventions, such as Chinese book content and Chinese quotes. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill is described as a hardcoded workflow for producing a card-style book/toolbook HTML, not as a marketing or audience-capture tool. The back cover includes公众号 promotion, keyword-triggered acquisition flow, and reader community funnel text, which adds an unjustified promotional capability beyond formatting and presentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Loading a third-party image without disclosure creates an undisclosed outbound connection whenever the page is opened online. In this skill's context—a supposedly self-contained HTML generator—this is more suspicious because users may reasonably expect no third-party requests, creating avoidable privacy leakage and compliance concerns.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The inline comment frames localStorage as merely an implementation detail of a dependency-free template, but the code is persisting reader preferences across sessions. While not a major security issue, that documentation understates the behavior and can mislead reviewers expecting a purely presentational single-file HTML without stored state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This Python file contains user-facing natural-language instructions, field names, and output descriptions entirely in Chinese, but it does not indicate that the skill is China-specific or that users may choose another language. That can violate language/locale policy when the skill is used in broader contexts without explicit opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language instructions and runtime messages only in Chinese, including the module docstring and usage output. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.