T06 · System Persistence
- Location
- SKILL.md:85
- Finding
- Persistent Daily Cron Task Installed by the Skill## Vulnerability Details **File Location**: `SKILL.md:85-88` **Vulnerability Type**: Persistent scheduled execution **Risk Level**: Medium ### Vulnerable Code Snippet ```text 4. Configure crontab in append mode without overwriting existing entries: 0 3 * * * python3 <skill_dir>/scripts/daily_review.py --workspace <workspace> --days 7 --update-timestamp --archive-days 30 > /tmp/cmm_review.log 2>&1 ``` ### Technical Analysis The mandatory first-run workflow directs the Agent to modify the user's crontab and register a job that executes every day at 03:00. This gives the Skill cross-session persistence: its Python script continues to run after the installation conversation and independently of subsequent user requests. The scheduled review is related to the declared memory-management functionality, and the instructions request confirmation before initialization. However, scheduler-level persistence exceeds the minimum privileges necessary because the review could instead run when the Agent is activated or when the user explicitly requests it. The installation process does not define: - An uninstall or rollback procedure. - A duplicate-entry check. - A canonical or integrity-checked script path. - A mechanism for suspending unattended execution. - A least-privilege alternative that avoids modifying the user's persistent scheduler. Repeated initialization may append duplicate cron entries. The job also inherits the permissions and environment of the user whose crontab is modified. ### Attack Path 1. The user installs and activates the Skill. 2. The mandatory first-run workflow offers one-click initialization. 3. The Agent appends the provided command to the user's crontab. 4. Cron invokes `daily_review.py` every day with the privileges of that user. 5. The execution persists across Agent sessions and continues until the crontab entry is manually removed. 6. If the referenced Skill script is subsequently modified or replaced, the cron ...[truncated 647 chars]
- Remediation
- ## Remediation Suggestions 1. Make cron registration explicitly optional rather than part of the mandatory initialization workflow. 2. Prefer running the review through an Agent activation hook or an explicit user command. 3. Display the exact scheduler modification and obtain specific confirmation immediately before applying it. 4. Check for an existing uniquely marked entry before appending a new one. 5. Add a documented uninstall command that removes only the Skill-owned entry. 6. Use a stable, user-owned script path and verify its ownership and permissions before scheduling it. 7. Run with the least-privileged account capable of accessing the intended workspace. 8. Consider a scheduler entry with a unique marker, restrictive environment, explicit interpreter path, and locked-down output location.
