Back to skill

Security audit

LPA审核技能

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Chinese-language LPA audit helper, but its generated HTML reports can execute unescaped content from audit data.

Review before installing if audit result JSON may come from other people or untrusted systems. Do not open generated HTML reports from untrusted data in a privileged browser session or host them in an authenticated site until the template and fallback renderer escape all dynamic fields. Expect Chinese-only output and user-directed local file writes.

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_report.py:39
Finding

Stored Cross-Site Scripting in Generated HTML Audit Reports

Content
View full analysis
str: """Render the template using Jinja2.""" try: from jinja2 import Template t = Template(template) return t.render(**data, datetime=datetime) except ImportError: # Fall back to inline generation return _generate_inline_html(data) ``` The fallback renderer also interpolates untrusted values directly into HTML: ```python issues_rows = "" for i, issue in enumerate(top_issues, 1): issues_rows += f""" {i} {issue.get('item_id', '')} {issue.get('name', '')} {issue.get('category', '')} {issue.get('evidence', '')} {issue.get('note', '')} """ ``` The primary HTML template displays the affected values in the document: ```html {% for issue in top_issues %} {{ loop.index }} {{ issue.item_id }}
Remediation
View remediation
str: return escape(str(value if value is not None else ""), quote=True) ``` Use `escape_html()` for `item_id`, `name`, `category`, `evidence`, `note`, audit metadata, category names, and recommendation content before interpolation. 4. Avoid inserting untrusted values into HTML attributes or CSS class names. Validate category values against a strict allowlist and use a fixed safe fallback. 5. Validate the JSON schema before analysis. Require expected scalar types, reject nested objects in text fields, and impose reasonable maximum lengths. 6. Add automated regression tests using payloads in every displayed field, including: ```html "> ``` Tests should verify that generated reports contain escaped text such as `<script>` and no executable elements or event-handler attributes. 7. Apply a restrictive Content Security Policy when reports are served over HTTP, for example: ```http Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src 'self' data:; script-src 'none'; base-uri 'none'; form-action 'none' ``` A C ...[truncated 120 chars]
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill references file-reading and file-writing workflows via local scripts and output paths, but it does not declare any explicit tool scope such as permissions or allowed-tools. This can cause the agent runtime to over-assume what the skill may access, increasing the risk of unintended filesystem access or unsafe execution in environments that rely on manifest-declared boundaries.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger conditions include broad keywords such as 'LPA', '审核清单', and '审核报告', which may cause the skill to activate outside narrowly intended audit workflows. Over-broad activation increases the chance that the agent applies file-processing or script-oriented behavior in unrelated contexts, which is more dangerous because the skill also describes local script execution and output generation.

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 sets lang="zh-CN" and uses a Chinese-only report title, indicating the skill output is fixed to Simplified Chinese. This can violate language/locale policy when the skill does not provide user opt-in, fallback, or documentation that the template is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire markdown file is written exclusively in Chinese, including headings, instructions, and tables, with no indication that language selection is optional. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale-policy issue unless the regional constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring and user-facing CLI help strings are all in Chinese, which effectively forces a specific language for users without any opt-in or explanation. Under the natural-language policy rule, this is a language/locale policy violation unless the file explicitly offers language choice or clearly documents a justified locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code performs a file write of a generated audit report, and the report content includes audit identifiers, department, auditor, evidence, and notes derived from input data. Although the write is part of the script's purpose, there is no explicit warning in code comments, prompts, or user-facing output before persistence that the operation stores potentially sensitive audit information to disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The HTML output sets lang="zh-CN" and uses fixed Chinese titles and labels throughout the report, which enforces a specific language/locale in the generated artifact. Under the policy, forcing a locale without user opt-in or a documented 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
85% confidence
Finding

文件中的技能名称、展示名称、描述和主要说明均固定为中文,但文档没有说明这是面向特定中文用户群体的区域性技能,也未提供语言选择或用户确认。按照语言/locale 政策,这种默认强制单一语言而无 opt-in 可能构成自然语言策略问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code performs a file write operation by creating or overwriting the JSON output file, but the script provides no explicit warning, confirmation prompt, or comment/disclosure about that side effect beyond the argument label. For code files, file writes can be flagged when they lack any visible user disclosure, and this write is safety-relevant because it modifies the filesystem.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.