T06 · System Persistence
- Location
SKILL.md:127- Finding
Mandatory Daily Cron Job Creates Cross-Session Persistence
- Content
View full analysis
**Self-healing loop = injection + snapshot + cron + verification; all four steps are required.** 4. **Register cron immediately (mandatory, not optional)**: ( crontab -l 2>/dev/null | grep -v 'heal.sh' ; echo '0 6 * * * /bin/bash "/scripts/heal.sh" >> ~/.openclaw/workspace/theme-coach/heal.log 2>&1' ) | crontab - crontab -l | grep heal.sh ``` The final checklist reinforces the requirement: ```text - [ ] Register the heal cron job (mandatory) and immediately run `heal.sh ` to verify the loop ``` ### Technical Analysis The Skill explicitly requires an agent to modify the user's crontab and execute `scripts/heal.sh` every day at 06:00. This scheduled task survives the original Skill session and continues executing code from the Skill installation directory. Automatic recovery may be useful for a theme that can be overwritten by upgrades, but mandatory daily execution is not the least-privileged mechanism necessary to design or install a UI theme. An on-demand repair command would satisfy the core functionality without persistent execution. The cron entry references the mutable Skill installation path rather than a version-pinned or integrity-verified copy. If `scripts/heal.sh` is subsequently changed through a compromised update, filesystem tampering, or package replacement, the cron job will execute the changed code automatically. ### Attack Path 1. A user asks the agent to install a theme. 2. Following the mandatory instructions, the agent adds the daily `heal.sh` entry to the user's crontab. 3. The Skill directory or `scripts/heal.sh` is later replaced or modified. 4. At the next scheduled time, cron invokes `/bin/bash` on the modified script. 5. The replacement code executes with the permissions ...[truncated 454 chars]- Remediation
View remediation
