Back to skill

Security audit

质量计划技能

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Chinese quality-plan document skill, but its HTML export can preserve active web code from document content or metadata in generated files.

Review this skill before installing if you will process uploaded or third-party Markdown. Use trusted inputs, confirm output filenames to avoid overwrites, and prefer sanitized HTML export or Markdown-only sharing for sensitive quality plans until the generator escapes metadata and strips unsafe HTML or JavaScript.

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
scripts/generate_html.py:54
Finding

Unescaped User-Controlled Content Allows Active HTML and JavaScript Injection

Content
View full analysis
', "

目 录

", '
    '] for h in headings: indent = " " * (h["level"] - 1) toc_lines.append( f'{indent}
  • {h["text"]}
  • ' ) toc_lines.append("
") toc_lines.append("") return "\n".join(toc_lines) def convert_md_to_html(md_content): """将Markdown内容转换为HTML片段""" extensions = [ TocExtension(permalink=False, slugify=slugify_cn), "tables", "fenced_code", ] html_body = markdown.markdown(md_content, extensions=extensions) return html_body def build_final_html(template_content, body_html, toc_html, metadata): """将模板、内容和元数据组合为最终HTML""" # 替换元数据占位符 result = template_content for key, value in metadata.items(): result = result.replace("{{" + key + "}}", str(value)) # 注入目录 result = result.replace("{{toc}}", toc_html) # 注入正文内容 result = result.replace("{{content}}", body_html) return result ``` The affected output sinks are the placeholders in `assets/html-template.html`, including: ```html {{title}} {{company}} {{doc_number}} {{version}}
{{product_name}}
{{toc}}
{{content}}
``` ### Technical Analysis The generator places several sources of user-controlled data directly into an HTML document: 1. Command-line metadata such as the title, product name, company, document number, version, and date is sub ...[truncated 3273 chars]
Remediation
View remediation
' f'{safe_text}' ) ``` 3. **Sanitize converted Markdown with a strict allowlist.** Process the generated body with a maintained sanitizer such as Bleach. Permit only the elements and attributes required by the quality-plan format, and prohibit scripts, event handlers, embedded frames, forms, and unsafe URL schemes. ```python import bleach allowed_tags = [ "h1", "h2", "h3", "p", "ul", "ol", "li", "table", "thead", "tbody", "tr", "th", "td", "pre", "code", "blockquote", "hr", "strong", "em", "a" ] allowed_attributes = { "h1": ["id"], "h2": ["id"], "h3": ["id"], "a": ["href", "title"], } body_html = bleach.clean( body_html, tags=allowed_tags, attributes=allowed_attributes, protocols=["http", "https", "mailto"], strip=True, ) ``` 4. **Disable raw HTML at the Markdown ingestion stage if it is not required.** Treat embedded HTML as plain text rather than trusted markup. Sanitization should still be retained as defense in depth. 5. **Use an auto-escaping template engine.** Replace manual `str.replace()` templating with a template engine such as Jinja2 configured with automatic HTML escaping. Explicitly mark onl ...[truncated 939 chars]
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 (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个完整的质量计划文档生成技能,核心能力应包括生成质量计划内容、覆盖多个业务模块、支持交互式确认和修改,并输出Markdown与HTML两种格式。而实际代码只包含一个HTML生成脚本:读取输入Markdown、提取标题生成目录、调用markdown库转为HTML、注入模板和元数据后输出HTML。它没有任何内容生成、质量计划业务逻辑、12模块组装、交互修改流程或Markdown输出实现。因此代码行为与声明的主要目的明显不一致,属于实质性能力缺失与用途缩窄的描述不符。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs the agent to read and write local files, but it declares no explicit tool scope or permission boundary. This increases the chance that an agent runtime grants broader file capabilities than users expect, enabling unintended file access or modification if the skill is triggered in the wrong context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger conditions are broad and do not define when the skill should not activate, which can cause it to run on loosely related requests. In a tool-enabled environment, overbroad activation increases the risk of unnecessary file operations, incorrect workflow takeover, or accidental handling of content outside the intended manufacturing quality-planning scope.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The operational text repeats broad trigger logic without defining non-applicable cases or requiring confirmation before takeover. This makes accidental invocation more likely and can expose local file workflows or scripted export steps in conversations that did not intend to authorize them.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs the agent to write and later edit a local Markdown file, but it does not clearly disclose to the user that files may be created, overwritten, or modified on disk. Hidden write behavior can lead to unintended data loss, overwriting of existing files with matching names, or surprise persistence of sensitive product information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The HTML export phase invokes a local script to transform content into a new file, but the skill does not clearly tell the user that code will be run and files will be generated. Running scripts without explicit disclosure weakens user consent and can become more dangerous if parameters like product name or company name are later passed unsafely into the script or template pipeline.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document is written entirely in Chinese and instructs the agent to use this framework when generating outlines, which effectively imposes a specific language/locale behavior. There is no indication that users may choose another language or that the Chinese-only constraint is justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and all user-facing CLI descriptions and error messages are written only in Chinese, which imposes a specific language on users without offering a choice. Under the stated policy, forcing a locale/language without opt-in 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", which hard-codes the document language/locale to Simplified Chinese. Under the policy rules, forcing a specific language without opt-in or a clearly documented regional justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file is entirely written in Chinese and does not indicate that language selection is optional or that the content is intentionally limited to a Chinese-speaking or China-specific audience. Under the policy rule for language/locale constraints, this can be considered a natural-language policy violation because it implicitly enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code performs a filesystem write and may also create parent directories, but there is no confirmation prompt or explicit user-facing warning immediately before the operation. Although the CLI arguments imply output generation, the code itself provides no disclosure about the file write side effect beyond the parameter name.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.