Back to skill

Security audit

现场检查报告辅助技能

Security checks for vulnerabilities and agentic risk

Overview

The skill coherently creates local inspection reports, but its HTML report generation can preserve sensitive photos and does not require sanitizing report text before it becomes an active HTML file.

Review before installing. Use this only with trusted inspection inputs, and treat the generated HTML as active content until report fields are escaped or sanitized. Be aware that photos and report data are written locally and embedded into a distributable HTML file, so remove generated artifacts when they are no longer needed.

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

Warning
Location
assets/report-template.html:5
Finding

Unsanitized Report Content Allows HTML and JavaScript Injection

Content
View full analysis
{report_title} ``` ```html {check_type} {check_location} {check_time} {check_personnel} {check_object} ``` ```html

{check_overview}

``` ```html {problems_section} ``` ```html {rectification_section} ``` ```html

{conclusion_text}

``` The instructions in `SKILL.md:57-59` direct the agent to read this template and replace all template variables when assembling the report. They do not require escaping or sanitizing collected report content. ### Technical Analysis Inspection details supplied by users are placed into HTML text and document-body contexts. The generation process does not define any HTML encoding, sanitization allowlist, URL validation, or Content Security Policy. An attacker who controls an inspection field can therefore supply HTML instead of plain text. For example, a value containing an element with an event handler could execute JavaScript when the generated report is opened: ```html ``` The title placeholder is also vulnerable to context breakout using a value beginning with ``. The `problems_section` and `rectification_section` placeholders intentionally accept complete HTML fragments but impose no restrictions on elements, attributes, URL schemes, embedded frames, scripts, or event handlers. Because the generated artifact is a standalone HTML file, injected active content is interpreted by the recipient's browser ...[truncated 1459 chars]
Remediation
View remediation
`, `"`, and `'`. - Do not perform unrestricted string replacement with raw user values. 2. **Safely generate structured sections** - Construct problem and rectification sections through a template engine with automatic escaping enabled. - Keep text values separate from trusted markup. - Avoid accepting complete user-controlled HTML fragments. 3. **Sanitize any intentionally supported rich text** - Use a maintained HTML sanitizer with a strict allowlist. - Permit only necessary formatting elements and attributes. - Reject `script`, `iframe`, `object`, `embed`, `svg`, `math`, form controls, event-handler attributes, and dangerous URL schemes such as `javascript:`. - Restrict images to the expected `data:image/jpeg;base64,...` format generated by the image-processing script. 4. **Add a restrictive Content Security Policy** - Add a policy similar to: ```html ``` - Avoid enabling inline scripts or network connections. 5. **Validate generated output** - Scan the completed document before delivery for scripts, event-handler attributes, remote URLs, embedded frames, and unresolved placeholders. - Add tests using payloads that attempt text-context and title-context breakouts. 6. **Document the trust boundary** - Update `SKILL.md` to explicitly require escaping plain-text fields and sanitizing structured HTML before substitution. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

声明描述的是一个完整的“现场检查网页报告生成”能力,包含图文整理和结构化HTML输出;但提供的代码片段只实现了图片压缩、格式转换、base64编码以及JSON写出,用于后续HTML使用。它没有生成HTML页面、没有整合文本记录、没有构建报告结构。虽然该代码可能是报告生成流程中的一个支持性子步骤,但就此代码块本身而言,其实际主要目的与声明的技能目的不一致,因此应判定为描述与行为存在明显不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs saving images to ./inspection_images/, generating image_data.json, and outputting a local HTML file, which are file-write capabilities, but it declares no permissions or allowed-tools scope. This creates an authorization gap where an agent may perform filesystem actions without explicit user-visible scoping, increasing the risk of unexpected local data persistence and privacy exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Using the overly broad trigger word “完成” can collide with ordinary conversation and prematurely transition the skill into report-generation mode. In this skill, that transition can lead to file creation and image processing, so accidental triggering may cause unintended persistence of sensitive inspection data and incorrect report outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill stores现场 images locally and embeds them as base64 into an HTML report, but it does not prominently warn the user that files will be written and that potentially sensitive photos will be preserved inside distributable output. This is dangerous because inspection images may contain proprietary, personal, or safety-sensitive information, and users may not realize the persistence and sharing implications of the generated artifacts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains user-facing natural-language strings and documentation entirely in Chinese, including the module description and later CLI/help output. Under the policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The HTML root sets lang="zh-CN", and the visible report labels throughout the template are written in Chinese, which indicates the skill output is fixed to a specific language/locale. There is no natural-language indication in this file that users can opt into another language or that the locale restriction is required for a region-specific use case.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.