Back to skill

Security audit

Disk Space Analyzer

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real disk-space reporter, but it needs review because it scans broad local disk metadata and generates an unsafe HTML report from file and folder names.

Review before installing. Use it only if you are comfortable with a local scan that records drive structure, directory names, full paths, cache locations, Windows component sizes, and hostname into report files. Do not share generated reports casually. The HTML report generation should be fixed to escape data or use safe DOM/text rendering before use, especially on systems where file or folder names may come from untrusted archives or other users.

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
SKILL.md:43
Finding

Stored JavaScript Injection Through Unsafe Report Data Embedding and DOM Rendering

Content
View full analysis
${dir.name}${isBig?' 大户':''} ${fmtSize(dir.size_gb)} ${pct}% `; ``` ```javascript
${loc.path}
``` ### Technical Analysis The scanner co ...[truncated 3480 chars]
Remediation
View remediation
SAFE_JSON ``` Before insertion, serialize the data and escape at least `<`, `>`, `&`, U+2028, and U+2029. For example: ```python json_str = json.dumps(data, ensure_ascii=False, separators=(",", ":")) json_str = ( json_str .replace("&", "\\u0026") .replace("<", "\\u003c") .replace(">", "\\u003e") .replace("\u2028", "\\u2028") .replace("\u2029", "\\u2029") ) ``` Read it using `textContent` and `JSON.parse()`: ```javascript const REPORT_DATA = JSON.parse( document.getElementById("report-data").textContent ); ``` 3. **Eliminate untrusted `innerHTML` construction** Build report elements with DOM APIs and assign filesystem-derived values through `textContent`: ```javascript const cell = document.createElement("td"); cell.textContent = dir.name; row.appendChild(cell); ``` Static markup may be created separately, but directory names, paths, hostnames, and all other scan-derived values must never be concatenated into HTML. 4. **Use contextual sanitization where HTML is unavoidable** If rich HTML rendering cannot be removed, process generated markup with a well-maintained HTML sanitizer configured to reject script elements, event-handler attributes, unsafe URLs, SVG scripting, and other active content. Encoding remains preferable when values are intended to be plain text. 5. **Add security regression tests** Generate and open reports ...[truncated 609 chars]
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (17)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 41)May include surrounding context.

md
2. Copy `assets/report_template.html` to the workspace as the HTML output file

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill instructs the agent to run a local scanner and write JSON/HTML artifacts, but it does not declare any explicit tool scope or permissions. That creates an authorization gap: an agent may access environment data and write files without the skill clearly constraining or disclosing those capabilities, increasing the chance of overbroad execution and unintended data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says the tool scans all disk drives, but it does not clearly warn that directory names, drive structure, cache locations, and Windows component metadata will be inspected and included in a report. This weak disclosure is risky because file and folder names can reveal sensitive projects, usernames, applications, or business context even without reading file contents.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad everyday phrases like 'disk space' and '帮我看看磁盘', which can cause the skill to activate in contexts where the user did not intend a full-disk scan. Because the skill scans all drives and enumerates directory metadata, accidental invocation can lead to unnecessary privacy-sensitive inspection of the local system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The HTML document declares lang="zh-CN" and all visible UI text in the template is fixed in Simplified Chinese. This imposes a specific language/locale on all users without offering opt-in, selection, or documenting that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 344)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 349)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 420)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 422)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 505)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 515)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · assets/report_template.html (reported line 516)May include surrounding context.

html
}

  for (const d of data.drives) {
    const deepList = d.deep_consumers || [];
    const dirs = d.top_directories || [];

    // Pick the biggest culprit trace across all deep consumers

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The template presents injected special_locations entries as 'safe cache/temp files' and explicitly states deletion 'will not affect system and applications,' but the HTML/JS performs no validation that those paths are actually safe. If upstream data is wrong, compromised, or manipulated, the report could socially engineer users into deleting important files or directories, causing data loss or application/system instability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The natural-language labels for special locations are hard-coded in Chinese, which imposes a specific language on all users of the script. There is no option to select locale or indication that the skill is intentionally region-specific, so this conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest describes disk space analysis and report generation, which naturally implies reading filesystem metadata and producing a report. However, the code also supports writing JSON output to any caller-supplied path via --output, which is a persistent filesystem modification not mentioned in the skill description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The primary description and trigger phrases are presented in Chinese only, which indicates a language-specific interaction model without any stated opt-in or alternative language support. This can violate language/locale policy when a skill implicitly forces one language rather than offering a choice or documenting the locale restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

Disk usage analysis does not require gathering device identity information. Including the hostname in the generated report expands the skill from storage analysis into host-identification without any clear connection to the manifest's stated purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.