T06 · System Persistence
Error
- Location
- SKILL.md:31
- Finding
- Persistent Scheduled Execution Through Cron## Vulnerability Details **File Location**: `SKILL.md`, lines 31-34 **Vulnerability Type**: Scheduled cross-session execution **Risk Level**: High ### Vulnerable Code ```markdown ### 设置自动备份 (每日凌晨 2 点) ```bash ~/.openclaw/workspace/scripts/setup-backup-cron.sh ``` ``` ### Technical Analysis The Skill instructs the user to execute `setup-backup-cron.sh` to establish an automated backup task that runs every day at 02:00. A cron entry survives the current agent session and executes without subsequent user interaction, constituting system persistence. The referenced setup script is not included in the audited project. Consequently, the audit cannot verify the precise cron expression, executed command, environment, permissions, logging behavior, or whether the installation process creates additional persistent mechanisms. The scheduled target is also located in a user-writable workspace, making its future behavior dependent on the integrity of a mutable file. ### Attack Path 1. The user follows the Skill instructions and invokes `setup-backup-cron.sh`. 2. The script installs a recurring cron entry under the user's account. 3. The cron entry invokes a script from the mutable `~/.openclaw/workspace/scripts/` directory. 4. An attacker with the ability to modify that script replaces or alters it after cron installation. 5. Cron executes the modified commands automatically at the scheduled time. 6. The malicious execution repeats across sessions until the cron entry is removed. ### Impact Assessment Exploitation permits recurring command execution with the privileges of the account that owns the cron entry. This can affect all files and resources accessible to that account, including OpenClaw identity, personality, memory, user-information, knowledge-base, and backup files. It does not, based on the available evidence, grant root privileges or cross an operating-system privilege boundary by itself.
- Remediation
- ## Remediation Suggestions - Include the cron setup and backup scripts in the reviewed package rather than referencing unavailable implementations. - Display the exact cron entry and require explicit user approval before installing it. - Resolve executable paths from a trusted, package-controlled directory instead of a mutable workspace. - Verify script ownership, restrictive permissions, and a cryptographic checksum or signature before installation and before each execution. - Ensure scripts are not writable by other users or untrusted processes. - Run the task with the minimum required account privileges and a restricted environment and `PATH`. - Document how to inspect and remove the installed cron entry. - Provide an opt-in manual backup mode that does not create persistent scheduled execution.
