Back to skill

Security audit

智能保洁助手

Security checks for vulnerabilities and agentic risk

Overview

This cleaning skill is mostly purpose-aligned, but its generated reports can execute unsafe HTML and load third-party JavaScript despite being presented as local reporting.

Review this skill before installing if you will store real household or office routine data. Use it only if you are comfortable with local SQLite records, avoid putting untrusted text into cleaning records, and be aware that opening generated reports may contact a third-party CDN and execute browser JavaScript. Prefer a version that removes WebFetch, bundles Chart.js locally with integrity controls, escapes report fields, confirms saves/deletes, and restricts report output to the skill data directory.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cleaning_report.py:78
Finding

Stored HTML and JavaScript Injection in Generated Reports

Content
View full analysis
0 else f"{mins}分钟" note = e.get("note", "")[:20] or "-" table_rows += f""" {e.get('date', '')} {rooms_display} {dur_display} {note} """ ``` ### Technical Analysis The `date`, `rooms`, and `note` fields are inserted directly into an HTML document without context-appropriate escaping. These values originate from cleaning records supplied through the command-line interface and stored in SQLite. SQL parameterization protects the database from SQL injection, but it does not make retrieved strings safe for insertion into HTML. An attacker-controlled value such as: ```html ``` can therefore become an active HTML element when placed in the `rooms` field. The browser executes the event handler when the generated report is opened. Because the malicious value is stored in the database, this is a stored injection vulnerability. The 20-character truncation applied to `note` is not a security control. Other fields, particularly `rooms`, are not truncated, and sufficiently compact payloads may also bypass length-based restrictions. ### Attack Path 1. An attacker or untrusted input source supplies a cleaning record containing an HTML payload in the room, date, or note field. 2. `cleaning_db.py` stores the value unchanged in `cleaning.db`. 3. The user generates a monthly HTML report. 4. `cleaning_report.py` retrieves the record and interpolates the malicious fiel ...[truncated 832 chars]
Remediation
View remediation
`, event-handler attributes, quotes, and `` sequences. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/cleaning_report.py:118
Finding

Remote JavaScript Dependency Loaded Without Subresource Integrity

Content
View full analysis
``` ### Technical Analysis Every generated report loads and executes Chart.js from a third-party content delivery network at viewing time. Although the dependency version is pinned, the script does not include a Subresource Integrity hash. Consequently, the executable content ultimately depends on the response returned by the CDN rather than solely on code reviewed in the Skill package. A compromise of the CDN, its distribution path, or the referenced artifact could cause arbitrary JavaScript to execute in all generated reports. Opening the report also initiates an external request that is not necessary for an otherwise local reporting workflow. This discloses request metadata such as the user's IP address, browser headers, and report-opening time to the CDN. ### Attack Path 1. The user generates a cleaning report. 2. The user opens or previews the report while network access is available. 3. The browser requests Chart.js from `cdn.jsdelivr.net`. 4. If the CDN response or hosted asset has been compromised, the browser receives attacker-controlled JavaScript. 5. Because no integrity hash is present, the browser has no expected-content digest against which to verify the response. 6. The attacker-controlled script executes within the generated report. ### Impact Assessment A compromised dependency can obtain the same browser-level capabilities as other JavaScript in the report, including: - Reading and modifying report content. - Accessing cleaning records rendered in the DOM. - Sending browser-permitted requests to external systems. - Redirecting or misleading the user. The external request also creates a privacy exposure even when the returned library is l ...[truncated 91 chars]
Remediation
View remediation
``` 3. Verify the integrity digest independently against the intended release artifact. 4. Define a restrictive Content Security Policy that only permits required local resources or explicitly approved origins. 5. Document the external request and provide an offline-report mode. 6. Establish a dependency update and vulnerability-monitoring process for the bundled or remotely loaded library. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cleaning_report.py:596
Finding

Arbitrary File Overwrite Through Unrestricted Report Output Path

Content
View full analysis
5 else None if output_path is None: output_path = str(SKILL_DIR / "data" / f"cleaning_report_{year}_{month:02d}.html") html = generate_report(year, month, summary, entries) Path(output_path).parent.mkdir(parents=True, exist_ok=True) Path(output_path).write_text(html, encoding="utf-8") ``` ### Technical Analysis The optional output path is accepted directly from a command-line argument. The code does not require the resolved destination to remain inside the documented `{baseDir}/data` directory. Absolute paths and traversal paths such as `../../target.html` are accepted. Parent directories are created automatically, and `write_text()` overwrites an existing file by default. A caller that can influence this argument can therefore write the generated HTML to any filesystem location writable by the Python process. The contents are constrained to the generated report, but this does not eliminate the risk of destructive overwrite or placement in a security-sensitive, web-served, or automatically processed directory. ### Attack Path 1. An attacker influences the optional report output argument. 2. The attacker supplies an absolute path or a path containing traversal components. 3. `Path(output_path).parent.mkdir()` creates missing parent directories where permissions permit. 4. `Path(output_path).write_text()` creates or overwrites the selected file. 5. If the target is a user configuration file, existing data may be destroyed. If it is a web-served HTML location, the injected report content may become externally reachable. ### Impact Assessment The attacker gains file-creation and file-overwrite capability within the permissions of the Agent's Python process. Potential impact includes: - Destruction of writ ...[truncated 465 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Note
Location
SKILL.md:14
Finding

Unnecessary WebFetch Capability Violates Least Privilege

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

该代码块的实际功能比较单一:维护一个大型清洁知识字典,并通过命令行支持 categories 和 search 两个操作,返回匹配的清洁方法、频率、工具、注意事项等内容。虽然声明中包含“保洁知识库(去油污/除水垢/防霉/地板护理等)”,这部分与代码高度一致,但声明的主体是“全流程管理助手”,并明确列出计划生成、清单、库存、记录、SQLite、HTML报告等能力;这些在代码中完全没有体现。因此描述明显夸大了实现范围,属于描述与行为不符。未发现越权访问、网络、文件数据库写入等额外未声明敏感行为;问题主要是声明远超实际实现。

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Very broad trigger phrases such as common household terms can cause the skill to activate during ordinary conversation when the user did not intend to invoke persistent storage or tool-backed actions. In this skill's context, accidental activation matters more because it can lead to automatic record handling and command execution through enabled tools.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Granting Bash to a cleaning assistant unnecessarily broadens its execution surface beyond the stated local task-management purpose. If later prompts, parsed user input, or helper scripts are unsafe, this permission can enable command execution, file manipulation, and chaining with other tools, making benign functionality much more dangerous.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

WebFetch is not justified by the documented feature set, which is described as local SQLite storage and local report generation. Unnecessary network capability increases the blast radius by allowing data exfiltration, remote content retrieval, and prompt/data smuggling if the skill or downstream scripts ever consume external resources.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module-level record triggers are especially ambiguous because phrases like '今天打扫' or '做了卫生' naturally occur in casual chat and are tied to automatic saving behavior. This raises the risk of unintended persistence of personal routine data and unintended tool invocation without clear consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Automatically saving natural-language cleaning records without a clear upfront warning or consent mechanism creates a privacy and data-retention risk. Because the skill stores dates, locations, routines, and time spent in local SQLite, users may disclose sensitive household patterns without realizing the data is being persisted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module description and all user-facing CLI messages are written in Chinese, and there is no indication that users can opt into another language or locale. This creates a natural-language policy concern where the skill appears to enforce a single language by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This CLI path deletes a database record and immediately commits the change, but there is no confirmation prompt, cautionary output, or explicit warning to the user before the irreversible operation. The surrounding code comments and docstrings also do not disclose the destructive behavior in a user-facing way.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The checklist delete subcommand removes a checklist item and returns success immediately, with no confirmation or warning despite the action being destructive. Because the operation changes persisted user data, some form of disclosure or explicit acknowledgement is expected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file's natural-language strings and generated HTML are hard-coded in Chinese, including the page lang attribute and all user-visible labels, with no opt-in or language selection. This is a language/locale policy issue because the skill enforces a specific language rather than offering the user a choice.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The generated report includes Chart.js from a third-party CDN, which introduces an external trust dependency into an otherwise local reporting flow. If the CDN response is tampered with, blocked, or swapped, opening the report can execute attacker-controlled JavaScript in the user's browser and leak report contents or metadata.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The report silently loads external JavaScript from a CDN when opened, causing network access and execution of third-party code without user awareness. In a skill marketed around local storage/reporting, this increases privacy and supply-chain risk because report viewing can expose usage patterns and depend on an external provider.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script accepts an arbitrary output path from the command line and writes the generated HTML there without constraining it to the skill's intended data directory. An attacker or abusing caller could overwrite other user files writable by the process, place HTML in sensitive locations, or abuse the tool as a generic file-write primitive.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code file embeds all user-facing knowledge and several CLI messages in Chinese, which effectively forces a specific language for users. Under the policy, language constraints should be optional, user-selectable, or explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code generates an HTML report from user-provided summary and entry data and writes it to a file path, but there is no confirmation prompt, comment/docstring warning in main, or user-facing notice before the write occurs. Because file creation can affect user data and filesystem state, the operation should be disclosed somewhere in the skill's behavior.

Content

No source excerpt is available for this finding.