T09 · Insecure Skill Coding Practices
- Location
SKILL.md:133- Finding
Overbroad Destructive Log and Cache Cleanup
- Content
View full analysis
7 days) find /var/log -name "*.log" -mtime +7 -delete 2>/dev/null find ~/.cache -type f -mtime +7 -delete 2>/dev/null # Clean temp files rm -f /tmp/agent-temp-* 2>/dev/null rm -rf ~/.cache/pip 2>/dev/null ``` ### Technical Analysis The Skill describes these commands as “safe” auto-fixes, but their deletion scope is not limited to files created or owned by the Skill. The first command deletes every file ending in `.log` under `/var/log` if it is older than seven days. When executed with sufficient privileges, this can remove logs belonging to unrelated applications and system components. The second command recursively deletes all old files under the current user's cache directory, regardless of which application owns them. The final command removes the complete pip cache without checking whether another operation depends on it. The commands do not provide a dry-run, validate the resolved paths, enforce filesystem boundaries, preserve an audit record, or request confirmation. Redirecting standard error to `/dev/null` also conceals permission failures and partial cleanup, making it difficult to determine what was removed. ### Attack Path 1. The Agent observes disk usage above the documented critical threshold. 2. It interprets the cleanup commands as authorized “safe” automatic actions. 3. The Agent runs the commands using its current account or an elevated execution context. 4. `find` traverses system-wide or user-wide directories and identifies files unrelated to the Skill. 5. Matching logs and cache files are permanently deleted. 6. Operational diagnostics, audit evidence, or application state stored in those locations becomes unavailable. An attacker who can influence disk usage or persuade the Agent that disk pressure is critical could increase the likelih ...[truncated 792 chars]- Remediation
View remediation
