Back to skill

Security audit

巡店管理全流程助手

Security checks for vulnerabilities and agentic risk

Overview

The store-inspection skill is mostly coherent, but its generated HTML reports can run injected script from inspection data and load a remote charting script, so it needs review before use.

Review this skill before installing in a production or sensitive business workspace. Use it only with trusted inspection data, avoid opening generated HTML reports built from untrusted store names or issue text, and prefer a fixed version that escapes report fields and bundles or pins Chart.js locally.

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

Error
Location
scripts/store_inspection.py:642
Finding

Stored Cross-Site Scripting in Generated HTML Reports

Content
View full analysis
{name} {grade}级
{stats['latest_score']}/100
巡检{stats['count']}次 最高{stats['max_score']} {trend_icon}趋势
""" ``` Issue fields are also inserted into table markup without contextual encoding: ```python issue_rows = "" for issue in all_issues[-15:]: sev_color = "#ef4444" if issue.get("severity") == "P0" else "#eab308" issue_rows += f""" {issue.get('severity','P1')} {issue.get('dimension','')} {issue.get('item','')} {issue.get('action','')} """ ``` The latest store name is likewise rendered directly: ```python {latest['store_name'] if latest else ''} - {latest['inspection_date'][:10] if latest else ''} | 总分 {latest['total_score'] if latest else 0}/100 | {latest['grade'] if latest else ''} ``` Store names are additionally serialized into an executable inline script: ```python labels: {json.dumps(list(store_stats.keys()), ensure_ascii=False)}, ``` ### Technical Analysis Inspection values originate from interactive user input or locally stored JSON records. The report generator treats those values as trusted and concatenates them directly into an HTML document. At ...[truncated 2638 chars]
Remediation
View remediation
... ``` Before embedding serialized JSON in HTML, encode HTML-significant characters, especially `<`, for example by replacing it with `\u003c`. Parse the data using `JSON.parse(document.getElementById("report-data").textContent)`. 3. Prefer constructing report elements through DOM APIs and assigning untrusted values through `textContent` rather than `innerHTML`. 4. Validate every loaded inspection file against a strict schema. Enforce expected types, maximum lengths, and allowed values for fields such as severity and status. Validation is defense in depth and must not replace output encoding. 5. Add a restrictive Content Security Policy. Remove inline scripts where practical and disallow inline event handlers. A suitable baseline should restrict scripts to explicitly approved sources. 6. Add regression tests covering payloads containing: - `` - Event-handler attributes - Quotes and apostrophes - Ampersands and angle brackets - Unicode and malformed markup 7. Consider bundling Chart.js locally. If the CDN remains in use, add Subresource Integrity and `crossorigin="anonymous"` to reduce dependency-tampering risk. ]]>
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is broad and overlaps with ordinary retail/business phrases such as '巡店', '门店检查', and '门店评分'. In an agent environment, overly generic activation terms can cause accidental invocation in unrelated conversations, leading to unintended file generation, planning, analysis, or other side effects without clear user intent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill declares many broad trigger phrases such as '巡店报告', '门店检查', and 'store inspection' that overlap with ordinary business requests. This can cause unintended activation, leading the agent to invoke a file-writing workflow or store-analysis behavior when the user did not explicitly intend to use this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README-style trigger guidance uses natural-language examples without constraints, which increases ambiguity around when the skill should engage. In an agent environment, this can route generic operational queries into this skill unexpectedly, causing unintended data handling, report generation, or local file creation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code presents its interface, prompts, and generated report content entirely in Chinese, including the HTML document language declaration later in the file, with no opt-in or alternative locale path. That can violate language/locale policy when a skill imposes a specific language on users instead of allowing choice or clearly documenting a justified regional constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The generated HTML report loads Chart.js from a third-party CDN, which introduces remote script execution whenever the report is opened. If the CDN is unavailable, compromised, or intercepted, the report can execute attacker-controlled JavaScript in the viewer's browser and leak report contents or run further browser-based attacks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

整个 README 及触发词均仅提供中文内容,没有说明该技能是否仅面向中文用户,也未提供语言选择或英文等替代说明。按照语言/locale 政策,这可能构成默认强制特定语言而未取得用户选择。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README documents commands that generate local JSON data and interactive HTML reports but does not clearly warn users about filesystem writes or local artifact creation. This can cause users or calling agents to invoke the skill without understanding that it will persist data or create files, increasing the risk of unintentional data exposure or workspace modification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill outputs JSON data and interactive HTML reports and states that data is stored locally, but it does not clearly warn users up front that files will be written. This can surprise users, create unwanted local artifacts, and expose business-sensitive inspection data if written to insecure or unexpected locations.

Content

No source excerpt is available for this finding.