T09 · Insecure Skill Coding Practices
- Location
scripts/setup-watchdog.sh:121- Finding
Overbroad Cron Filtering Can Delete Unrelated Scheduled Tasks
- Content
View full analysis
/dev/null | grep -v "watchdog.sh") | crontab - # Add new cron job (crontab -l 2>/dev/null; echo "$CRON_JOB") | crontab - ``` Related unsafe removal instructions also appear in: ```bash crontab -l | grep -v watchdog | crontab - ``` at `SKILL.md:44` and `scripts/setup-watchdog.sh:137`. ### Technical Analysis The installer removes every cron entry containing the generic substring `watchdog.sh`, rather than removing only the exact entry owned by this skill. The documented uninstall command is even broader and removes every line containing `watchdog`. Consequently, unrelated monitoring, backup, security, or maintenance tasks can be silently deleted. The read-filter-write approach also lacks synchronization: a concurrent cron update occurring between the two `crontab -l` operations can be lost. The watchdog's user-level cron registration is consistent with its declared self-healing function and does not itself exceed the required privilege boundary. The unsafe matching and modification strategy, however, affects cron entries outside the skill's ownership. ### Attack Path 1. The user already has an unrelated cron task whose command or path contains `watchdog.sh` or `watchdog`. 2. The user runs `scripts/setup-watchdog.sh`, or follows the documented removal command. 3. `grep -v` removes the unrelated entry along with the OpenClaw entry. 4. The modified cron table is installed without warning or backup. 5. The unrelated monitoring or maintenance task ceases to run, potentially concealing failures or causing service disruption. A local process that can race cron modifications could also arrange for legitimate concurrent changes to be overwritten. ### Impact Assessment The impact is limited t ...[truncated 252 chars]- Remediation
View remediation
