T06 · System Persistence
- Location
scripts/install-cron.sh:49- Finding
Recurring Cron-Based System Persistence
- Content
View full analysis
/dev/null | grep -Fv "$CRON_TAG" || true; } | crontab - echo "✅ Removed openclaw-auto-update cron job" exit 0 fi # Add new cron entry NEW_CRON="$SCHEDULE bash $UPDATE_SCRIPT >> /tmp/openclaw-auto-update.log 2>&1 $CRON_TAG" { crontab -l 2>/dev/null | grep -Fv "$CRON_TAG" || true echo "$NEW_CRON" } | crontab - ``` ### Technical Analysis The installation script modifies the current user's crontab and registers `update.sh` for recurring execution. The scheduled task survives the installer process and subsequent agent sessions, making it a system-persistence mechanism. This behavior is explicitly documented, directly supports the declared automatic-update functionality, operates with user-level privileges, and includes an uninstall operation. It therefore does not appear concealed or unrelated. Nevertheless, it creates a persistent execution path that periodically changes OpenClaw and installed Skills without requiring approval for each update. The persistent task also increases the effect of any later compromise of `update.sh`, the Skill directory, the `openclaw` or `clawhub` executables resolved through `PATH`, or the upstream update channel. ### Attack Path 1. The user runs `scripts/install-cron.sh` as documented. 2. The script removes previous crontab lines carrying its tag and adds a new recurring entry. 3. Cron subsequently executes `scripts/update.sh` according to the configured schedule. 4. The updater modifies OpenClaw and installed Skills. 5. If OpenClaw changes and gateway restart is enabled, the updater also restarts the gateway. 6. A later compromise of the scheduled script, invoked command-line tools, or update source is automatically exercised on the next scheduled run. ### Impact Assessment T ...[truncated 397 chars]- Remediation
View remediation
