Back to skill

Security audit

cleanMyMacSkill

Security checks for vulnerabilities and agentic risk

Overview

This storage-cleanup skill is not clearly malicious, but it exposes real file-deletion power with weak scoping and inconsistent read-only messaging.

Review this skill before installing. Use static report mode for analysis-only use. Do not run the local server or click permanent delete unless you have backups and have manually reviewed every target path; the server's hard-delete path validation is too broad for a low-risk cleanup tool.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/build_report.py:45
Finding

Stored Script Injection Through Unsafe JSON Embedding

Content
View full analysis
const DATA = __REPORT_DATA__; const DELETE = __DELETE_CONFIG__; // null=static report; {token,endpoint}=server.py dynamic backend ``` ### Technical Analysis The report generators serialize analysis data with `json.dumps()` and directly substitute the result into an HTML ``. If a report field contains a value such as a crafted filename, path, description, or other analysis property with a closing script tag, the browser can terminate the original script element before the JavaScript parser processes the JSON. Subsequent attacker-controlled markup can then introduce a new executable script. Although most dynamically rendered report values later pass through the `esc()` function, that escaping occurs only after the initial `DATA` declaration has already been parsed. It therefore does not prevent this injection. The server configuration, including its random action token, is also embedded in the same page. JavaScr ...[truncated 1811 chars]
Remediation
View remediation
... ``` Then read and parse its text content: ```javascript const DATA = JSON.parse(document.getElementById('report-data').textContent); ``` 3. Before embedding serialized JSON in HTML, replace HTML-significant characters with Unicode escapes. At minimum, escape: - `<` as `\u003c` - `>` as `\u003e` - `&` as `\u0026` - U+2028 as `\u2028` - U+2029 as `\u2029` 4. Apply the same safe serialization function in both `build_report.py` and `server.py` so static and dynamic reports cannot diverge in security behavior. 5. Validate the analysis document against a strict schema, including type and length restrictions for every displayed field. 6. Add a restrictive Content Security Policy. Prefer external scripts with a nonce or hash and disallow arbitrary inline execution. 7. Add regression tests using values containing ``, HTML elements, quotes, Unicode separators, and event-handler payloads. 8. In server mode, consider separating the action token from report-readable JavaScript and require an additional server-enforced user authorization step for destructive requests. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/server.py:53
Finding

Permanent-Deletion Authorization Trusts Unvalidated Analysis Data

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (24)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The README presents the tool as a read-only storage analyzer, but also advertises a local server that enables one-click trashing and permanent deletion. This is a dangerous capability mismatch because an agent or user may grant trust or invoke the skill under the false assumption that it cannot modify files, increasing the risk of unintended destructive actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Claiming the project is read-only while documenting deletion and permanent removal functionality undermines informed consent and safe tool selection. In an AI-agent context, this discrepancy is especially risky because orchestration logic may classify the skill as low-risk and allow it to run in situations where destructive operations should be blocked or separately approved.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README characterizes the skill as "read-only" while the skill metadata and documentation also describe a local server mode that can move items to trash or delete them. This is a dangerous trust-boundary mismatch: users or downstream agents may grant the skill elevated trust and invoke it in contexts intended only for non-destructive analysis, increasing the risk of unintended destructive actions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description promises interactive cleanup, deletion, trashing, HTML reporting, and broad storage analysis, but the detected behavior does not implement those controls or features. Security-relevant description/behavior mismatches are dangerous because users and reviewers may approve the skill based on inaccurate claims about safeguards, boundaries, and functionality, leading to misplaced trust and unsafe operational assumptions. In this context, the mismatch is especially concerning because the declared purpose includes file-deletion workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The template is not purely read-only: when DELETE_CONFIG is populated, it renders one-click Trash/Delete controls and sends backend requests that can mutate the filesystem. That is a dangerous mismatch with the skill’s described purpose because users or integrating agents may trust the report as a passive analyzer while it actually enables destructive actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The page contains client-side functions that package filesystem paths and submit them to a backend endpoint with modes including 'trash', 'rm', and 'open'. This turns a report into an operational control surface for filesystem mutation; if token handling, path validation, local exposure, or report integrity are weak elsewhere, the page can be abused to delete data or trigger local file-manager actions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is presented as a read-only storage analysis helper, but this module exposes destructive capabilities: moving files to trash and irreversible deletion via a local HTTP API. That mismatch is dangerous because users or calling agents may grant trust based on the declared read-only purpose, while the actual implementation can modify or destroy data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly promotes a local web UI for one-click deletion and trash operations, but does not place a prominent, immediate warning near the usage flow about irreversible data loss, misclassification risk, or the need for user review before destructive actions. In the context of an AI-agent skill that classifies files and offers cleanup actions, this increases the chance that users or downstream agents treat suggested deletions as safe and remove important data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Claiming the tool is "Safety Centered" because deletion is protected by validation tokens and path boundaries does not resolve the core issue that the skill is presented elsewhere as read-only. Such reassuring language can cause users or integrating agents to underestimate risk, and the presence of a web server deletion surface adds meaningful attack and misuse potential even if some controls exist.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill requests or implies code-execution capabilities through shell, file read/write, and environment access but does not declare an explicit tool scope. That creates an authorization and review gap: operators and automated policy systems cannot clearly constrain what the skill may do, while the workflow includes writing to /tmp, reading generated files, and launching Python scripts. In a skill that scans the filesystem and advertises cleanup actions, missing scope declarations materially increase the risk of unintended file access or destructive follow-on behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly advertises one-click 'Move to Trash' and 'Hard Delete' actions without a prominent destructive-action warning, confirmation model, or clear safety limitations in the user-facing description. This is dangerous because users may invoke deletion features on large or misclassified paths with insufficient understanding of permanence, especially in a tool framed as a convenience cleaner. The storage-cleanup context increases risk because deletion is central to the workflow and mistakes can cause data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The UI exposes permanent deletion as a first-class action next to safer options, but the warning is easy to miss and does not provide strong friction before destructive use. In a storage-cleanup context, users are especially likely to act quickly, so understated warnings materially increase the chance of accidental irreversible data loss.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The UI tells users that the page ‘will not execute direct changes’ or only opens folders for review, but the same page can call a backend endpoint to perform open/trash/delete actions. Even if some wording is technically scoped, the overall presentation is misleading and can cause unsafe user consent because the interface downplays the page’s real authority.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script prints detailed host metadata and filesystem contents to stdout, including username, home directory, drive layout, installed-app related paths, and large directory names. In an agent skill context, that output may be forwarded to an LLM, UI, logs, or remote service, creating privacy and environment-disclosure risk that can aid fingerprinting or leak sensitive local information.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/scan.py (reported line 49)May include surrounding context.

python
def run(cmd, timeout=180):
    try:
        return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout).stdout
    except Exception:
        return ""

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docstring claims the endpoint cannot delete arbitrary files, but the actual policy allows hard deletion of any path present in the analysis JSON allowlist and under HOME. If the analysis file is malicious, tampered with, or generated incorrectly, the server will perform irreversible deletion on attacker-selected user files while presenting the operation as strongly guarded.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 93)May include surrounding context.

python
def _trash_macos(path):
    # osascript Finder delete -> macOS Trash.
    script = 'tell application "Finder" to delete (POSIX file %s as alias)' % json.dumps(path)
    r = subprocess.run(["osascript", "-e", script], capture_output=True, text=True)
    if r.returncode != 0:
        dest = os.path.join(HOME, ".Trash",
                             os.path.basename(path.rstrip("/")) + "." + time.strftime("%H%M%S"))

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 169)May include surrounding context.

python
target = path if os.path.isdir(path) else os.path.dirname(path)
    if sys.platform == "darwin":
        if target.rstrip("/").endswith(".app"):
            r = subprocess.run(["open", "-R", target], capture_output=True, text=True)
            if r.returncode != 0:
                raise OSError((r.stderr or "open -R failed").strip())
            return

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 173)May include surrounding context.

python
if r.returncode != 0:
                raise OSError((r.stderr or "open -R failed").strip())
            return
        r = subprocess.run(["open", target], capture_output=True, text=True)
        if r.returncode != 0:
            r2 = subprocess.run(["open", "-R", target], capture_output=True, text=True)
            if r2.returncode != 0:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 175)May include surrounding context.

python
return
        r = subprocess.run(["open", target], capture_output=True, text=True)
        if r.returncode != 0:
            r2 = subprocess.run(["open", "-R", target], capture_output=True, text=True)
            if r2.returncode != 0:
                raise OSError((r.stderr or r2.stderr or "open failed").strip())
    elif sys.platform.startswith("linux"):

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 179)May include surrounding context.

python
if r2.returncode != 0:
                raise OSError((r.stderr or r2.stderr or "open failed").strip())
    elif sys.platform.startswith("linux"):
        subprocess.run(["xdg-open", target])
    elif sys.platform.startswith("win"):
        subprocess.run(["explorer", target])
    else:

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/server.py (reported line 181)May include surrounding context.

python
elif sys.platform.startswith("linux"):
        subprocess.run(["xdg-open", target])
    elif sys.platform.startswith("win"):
        subprocess.run(["explorer", target])
    else:
        raise OSError("Opening folders is not supported on this platform")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The file presents the documentation in Chinese and labels itself as a Chinese document, which may impose a language preference if surfaced directly to users. Although an English link is present, the content itself does not state that the skill will adapt to the user's preferred language or require opt-in for Chinese.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code writes a standalone HTML report to the user's Desktop, and the documented input schema includes potentially sensitive system and user data such as user, home, filesystem, and disk details. While the script prints a success message after writing, it does not disclose beforehand that it will persist this potentially sensitive data to a user-visible file location.

Content

No source excerpt is available for this finding.