T06 · System Persistence
- Location
SKILL.md:122- Finding
Persistent Six-Hour Cron Job Executes a Mutable Root-Scoped Script
- Content
View full analysis
/dev/null; echo "0 */6 * * * /root/.openclaw/scripts/self-reflection.sh") | crontab - ``` ### Technical Analysis The Skill directs the user to make `/root/.openclaw/scripts/self-reflection.sh` executable and register it as a recurring cron job. The job survives completion of the Skill and executes the referenced script every six hours in the security context of the crontab owner. Although scheduled reflection relates to the declared automation functionality, persistent root-scoped scheduling is not necessary for on-demand reflection. The instructions do not request explicit confirmation before creating persistence, do not validate the script's ownership or integrity, and provide no removal procedure. The referenced script remains mutable. Any process or user that later gains write access to the script or its parent directory can alter the payload and obtain recurring execution. Re-running the installation command also appends duplicate entries because it performs no idempotency check. ### Attack Path 1. A user follows the Skill instructions with sufficient permission to write under `/root` and update the applicable crontab. 2. The Skill creates an executable script under `/root/.openclaw/scripts`. 3. A cron entry is installed and remains active across sessions and reboots where cron is enabled. 4. An attacker or compromised component modifies `self-reflection.sh`. 5. Cron executes the modified script every six hours with the crontab owner's privileges. ### Impact Assessment If installed in root's crontab as implied by the hardcoded paths, compromise of the script permits recurring root-level command execution. This could affect all local files, credentials, services, and users accessible to root. Even wh ...[truncated 244 chars]- Remediation
View remediation
