Back to skill

Security audit

hug-html

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly builds HTML templates, but it understates network, file-write, and active-script behavior enough to require review before installation.

Review this skill before installing. Avoid putting secrets, tokens, private URLs, or personal data in QR-code content or remote image URLs. Treat generated HTML as active content because specs can include JavaScript. Use explicit safe output paths, avoid untrusted --save-as names, and expect Chinese-only prompts/docs plus some currently broken commands.

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

Warning
Location
scripts/module_assembler.py:170
Finding

QR Code Content Is Disclosed to an Undeclared External Service

Content
View full analysis
str: """生成二维码组件HTML""" content = comp.get("content", "") size = comp.get("size", "120px") label = comp.get("label", "") # 使用QR码API生成 qr_url = f"https://api.qrserver.com/v1/create-qr-code/?size={size}x{size}&data={_esc(content)}" html = f'QR' ``` ### Technical Analysis The QR component embeds user-provided QR content directly into a URL hosted by `api.qrserver.com`. When the generated HTML is opened, the browser requests this URL and transmits the QR content to that third-party service. This behavior conflicts with the project's permission declarations in `SKILL.md` and `references/permissions.md`, which state that the Skill does not send data over the network and has no external network dependency. Although the Python process does not itself make the request, it deliberately generates HTML that causes a browser-side network request. The `_esc()` function performs HTML escaping, not URL query-component encoding. It therefore does not provide suitable handling for arbitrary query data. More importantly, escaping does not prevent disclosure because the QR content remains part of the outbound request URL. ### Attack Path 1. A user supplies a QR component whose `content` contains a private URL, invitation token, identifier, or other sensitive value. 2. `_gen_qrcode()` places that value into the `data` query parameter of an `api.qrserver.com` URL. 3. The generated HTML contains the remote URL as an image source. 4. The user opens the generated HTML in a browser. 5. The browser sends the QR content to `api. ...[truncated 667 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/grid_builder.py:1329
Finding

Unvalidated Template Name Allows Arbitrary JSON File Writes Through Path Traversal

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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 (56)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a feature-rich component/layout generation skill, but the supplied code chunk is limited to centralized path management. It computes directory paths for the skill and storage subfolders and does not implement any of the advertised core behaviors. While path management could be a supporting utility within such a skill, this chunk by itself does not substantiate the declared primary purpose and instead reflects a materially different immediate function.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a much broader template/component authoring system, including composition of atomic components, constraint management, cell merging, module hierarchy, built-in templates, a visual editor, auditing, and template save-as. The supplied code chunk does not implement those capabilities. Instead, it is a CLI utility focused on filling existing HTML templates via data-field markers, auto-generating placeholder content, extracting content back to JSON, and applying style presets. Chinese error handling and style presets are supported, and the code is somewhat template-oriented, but the primary behavior is materially narrower and different from the declared purpose. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a general-purpose component/template composition platform with editor, constraints, presets, auditing, and template management features. The supplied code instead has a much narrower purpose: generating one specific interactive calendar-dashboard specification file containing hardcoded layout sections and embedded client-side logic. While it does use a grid layout and includes some merged cells via fixed colspan fields, that is only an implementation detail of this one template, not the broad compositional framework described. There are no permissions or triggers to compare, and the code does not show unrelated sensitive behavior; the mismatch is primarily that the declared capabilities substantially overstate and mischaracterize the actual functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The supplied code chunk only implements offline generation of test grid specifications and module metadata persistence. It does support parts of the description: cell merging is demonstrated, and a two-level module system (base/composite) is referenced by exporting BASE_MODULES and COMPOSITE_MODULES and using composite modules in one template. However, most of the declared product-level capabilities are not evidenced in this code: there is no visual editor, no constraint engine, no audit step, no user-driven save-as flow, no explicit Chinese error handling, and only three templates are generated rather than 7+. The primary behavior of this chunk is narrower than the declared description, so this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

Most of the declared description is broadly consistent: the code clearly provides a two-level module system, cell spanning/merging via rowspan/colspan, style presets, post-generation audit, user template persistence, Chinese error handling, and a visual editing toolbar in generated HTML. However, there are notable description-behavior mismatches. First, the claimed '8 atomic components freely combinable + 3-level constraints' is not what this file concretely implements; instead it defines a large library of base CSS primitives and composite modules, while constraint handling is delegated optionally to an external module_assembler and is not fully realized here. Second, the claim of '7+ built-in templates' is overstated for this code chunk: only five template entries are present, one of which is file-backed. Therefore the description overstates and partially mischaracterizes the implemented capability set.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The core purpose mostly aligns at a high level with component-based assembly for grid cells and 3 constraint modes, and cell merging is indirectly supported through rowspan/colspan fields in example/spec handling. However, the declared description significantly overstates the implemented feature set. The code is primarily a renderer/assembler for HTML components with CLI utilities, not a full system containing a visual editor, template management, auditing, and save-as functionality. Additionally, the '8 atomic components' claim is misleading because one of the 8 defined types is a recursive composite container ('group'), not an atomic component. Therefore this is a meaningful description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The supplied code chunk implements a CLI wrapper around grid-spec-based HTML generation. It supports listing template types, generating from built-in template names or custom JSON specs, writing output HTML, optional content substitution, and Chinese-language error handling. However, the description claims many higher-level product capabilities that are not evidenced in this code: atomic component composition, three-level constraints, cell merging, a base/composite two-level module system, style presets, post-generation audit, user template save-as, and especially a visual editor. While '7+ built-in templates' may be partially consistent through imported built-in templates, the code shown does not itself demonstrate that count. Overall, the actual behavior is narrower than the declared purpose, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The description presents a much larger template composition platform, including atomic component composition, constraint levels, cell merging, module hierarchy, presets, auditing, and template save-as. This code chunk does not implement those core capabilities; instead, it focuses narrowly on wrapping HTML with a grid-aware visual editor and generating editor HTML from a file or a built-in template spec. Some claimed items are only partially supported or merely referenced indirectly: built-in templates exist as an imported registry, but this chunk does not demonstrate the count ('7+') or broader system features. It does support the grid-aware visual editor and Chinese-language error handling, which align with part of the description. Additionally, the code contains extra behavior not declared in the description, notably drag-and-drop image replacement and keyboard shortcuts (Ctrl+E, Ctrl+S). Therefore the declared description does not accurately represent this code chunk's actual behavior.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> 📚 **渐进式加载**:本技能采用渐进式 MD 体系,`SKILL.md` 为入口(≤230行),详细内容拆分到 `references/*.md` 按需加载。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
python scripts/visual_editor.py --template data/output/card.html -o data/output/editor.html

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generator takes template_spec['scripts'] and injects it directly into a

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The description explicitly advertises "Chinese error handling," which is a locale/language constraint in the skill's natural-language behavior. The file does not indicate that users can opt into another language or that the Chinese-only behavior is required for a region-specific compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This line says all scripts have built-in Chinese error prompts, which imposes a specific language on users. Because the file does not offer a language choice or explain a justified regional limitation, this conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description explicitly advertises "Chinese error handling," which implies a fixed language behavior. For an all-file-types policy check, this is a natural-language locale constraint and there is no indication here that users can choose another language or opt in to Chinese-only behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

该文件全文使用中文表述,且未说明这是面向特定中文用户群体的区域化文档,也未提供语言选择或切换说明。根据语言/区域政策,若技能内容默认强制特定语言而无用户选择或明确理由,属于自然语言策略违规。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains natural-language statements that the skill added '全面中文异常处理' and that all scripts output Chinese error messages. That imposes a specific language/locale behavior without any indication of user opt-in or a documented region-specific justification, which matches the policy-violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest focuses on atomic components, constraints, module composition, templates, visual editing, style presets, post-generation audit, template save-as, and Chinese error handling. This FAQ additionally documents external call-chain management via another skill (skill-sub), persistent user-template/version management, and an AI-driven '自由生成模式' that bypasses the grid engine, which materially extends the apparent scope beyond the manifest description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The text says that from v2.1.0 onward, all scripts output error messages in Chinese, which imposes a specific language on users. This is a natural-language locale policy issue because the document does not mention any option to select another language or opt in to Chinese output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The quick-start troubleshooting section explicitly says all error prompts have been changed to Chinese, and the version note says English tracebacks were replaced by Chinese error messages and repair suggestions. This enforces a language choice in natural-language behavior without presenting user opt-in or alternatives.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

At L136 the documentation claims the calendar-dashboard template provides year controls, weekend rules, holiday-range CRUD, shift-work management, calendar views, and workday statistics. Elsewhere in the guide, the skill is presented as a set of scripts that generate HTML files and a visual editor output (template_generator.py, grid_builder.py, visual_editor.py), with no documented runtime service, persistence layer, or backend operations that would substantiate true CRUD behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill documentation, including headings, field descriptions, examples, and command explanations, is written only in Chinese. This creates a language/locale constraint without any indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains natural-language instructions and output strings that effectively force a specific language/locale for users. Under the policy, language constraints should either be optional for the user or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Tainted flow: 'html' from pathlib.Path.read_text (line 109, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/content_filler.py (reported line 117)May include surrounding context.

python
try:
        out = Path(output_path)
        out.parent.mkdir(parents=True, exist_ok=True)
        out.write_text(html, encoding="utf-8")
    except Exception as e:
        show_error("文件错误", f"写入输出文件失败: {output_path}", f"检查目录权限: {e}")
        return None

Tainted flow: 'html' from pathlib.Path.read_text (line 109, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/content_filler.py (reported line 183)May include surrounding context.

python
try:
        out = Path(output_path)
        out.parent.mkdir(parents=True, exist_ok=True)
        out.write_text(html, encoding="utf-8")
    except Exception as e:
        show_error("文件错误", f"写入输出文件失败: {output_path}", f"检查目录权限: {e}")
        return None

Static analysis

No suspicious patterns detected.