T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:19
- Finding
- Destructive and Unguarded Recursive Cache Deletion## Vulnerability Details **File Location**: `SKILL.md`, lines 19–22 **Vulnerability Type**: Unsafe destructive shell command **Risk Level**: Medium ### Vulnerable Code ```bash rm -rf ~/Library/Caches/* ``` ### Technical Analysis The Skill directs the user to execute `rm -rf` against every visible entry under the current user's macOS cache directory. The `-r` option recursively removes directories, while `-f` suppresses confirmation and many errors. Shell wildcard expansion causes all matching entries to be deleted immediately without displaying their sizes, validating individual targets, creating a backup, or requesting confirmation. Although the command is limited to the current user's cache directory under normal shell expansion, application caches can contain offline content, recoverable application state, or data that is expensive to regenerate. The surrounding instructions characterize the operation as completely safe, which understates its destructive and irreversible nature. The note concerning permission grants or password entry could also encourage users to grant access unnecessarily, even though elevated privileges should not normally be required for user-owned caches. This is an insecure operational practice rather than evidence of malicious intent. The project contains no remote payload retrieval, persistence, credential collection, hidden code, or dependency-related behavior. ### Attack Path 1. A user follows the cleanup instructions and opens Terminal. 2. The user pastes `rm -rf ~/Library/Caches/*`. 3. The shell expands `*` to matching cache entries. 4. `rm` recursively and forcibly deletes those entries without review or confirmation. 5. Applications may lose cached state or offline resources and subsequently malfunction, rebuild data, or perform substantial downloads. No separate attacker-controlled input or privilege-escalation step is required; the risk arises directly from the documented destructive ...[truncated 724 chars]
- Remediation
- ## Remediation Suggestions 1. Replace blanket recursive deletion with an inspection-first workflow, such as reporting cache sizes before any removal. 2. Remove only explicitly selected, known application cache directories rather than using a wildcard across the entire cache directory. 3. Ask for explicit confirmation and identify the exact target before performing deletion. 4. Advise users to quit affected applications before clearing their caches. 5. Clearly disclose that deletion is irreversible and may remove offline resources or application state. 6. Do not suggest entering an administrator password or granting broader filesystem permissions for a current-user cache cleanup. 7. Prefer application-provided cache-management controls or macOS storage-management facilities where available. 8. If a command-line procedure remains necessary, first use a non-destructive command such as `du` to identify large cache directories, then provide narrowly scoped deletion instructions for user-approved targets.
