T06 · System Persistence
- Location
scripts/install.sh:31- Finding
Indefinite Cron-Based Execution of a Mutable Guardian Script
- Content
View full analysis
/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * $OPENCLAW_DIR/scripts/rollback-guardian.sh") | crontab - echo " ✅ Cron 任务已添加" ``` The same persistent installation mechanism is documented in `SKILL.md:126-136`: ```bash (crontab -l 2>/dev/null | grep -v "rollback-guardian"; echo "*/1 * * * * ~/.openclaw/workspace/skills/config-rollback/scripts/rollback-guardian.sh") | crontab - ``` ### Technical Analysis The installer adds a cron entry that executes `~/.openclaw/scripts/rollback-guardian.sh` every minute. This task survives the installation process, shell sessions, and individual rollback operations. It remains installed even when no configuration change is pending. Scheduled monitoring is related to the declared automatic rollback functionality and is documented. Nevertheless, permanent minute-by-minute execution exceeds the minimum lifecycle required for a five-minute rollback window. The task should only exist while a protected configuration change is pending. The installation process first copies the guardian into a general user-writable script directory: ```bash mkdir -p $OPENCLAW_DIR/scripts cp $SCRIPT_DIR/*.sh $OPENCLAW_DIR/scripts/ ``` Cron subsequently trusts the mutable script at that location. If another process or actor capable of writing files as the user replaces that script, the replacement will be executed every minute. This does not independently elevate privileges beyond the account that owns the crontab, but it provides a durable recurring execution mechanism within that account. The cron update also removes every existing entry containing the broad substring `rollback-guardian`: ```bash crontab -l 2>/dev/null | grep -v "rollback-guardian" ``` This can unintentionally delete unr ...[truncated 1628 chars]- Remediation
View remediation
