T06 · System Persistence
Warning
- Location
- SKILL.md:38
- Finding
- Persistent Scheduled and Boot-Time Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 38-51 **Vulnerability Type**: Scheduled-task persistence **Risk Level**: Medium ### Vulnerable Code ```bash openclaw cron add \ --name "feishu-cache-check" \ --schedule "0 9 * * *" \ --command "node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js" ``` ```bash openclaw cron add \ --name "feishu-cache-post-upgrade" \ --schedule "@reboot" \ --command "sleep 30 && node ~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js" ``` ### Technical Analysis The documentation recommends registering both a recurring daily task and a boot-triggered task. These tasks survive the original Skill invocation and repeatedly execute code from a user-writable workspace path. The invoked script modifies source code in the global OpenClaw installation and restarts the OpenClaw Gateway. Consequently, the scheduled commands establish a persistent execution path with effects beyond the session in which the Skill was initially configured. Although the persistence mechanism is documented and serves the stated cache-maintenance purpose, executing a script from a mutable workspace path creates a security boundary concern. If that script or its containing directory is subsequently replaced or compromised, the already-registered task will execute the modified code automatically. ### Attack Path 1. A user follows the documented setup instructions and registers the daily or boot-time OpenClaw cron task. 2. The task remains registered after the current session and across system restarts. 3. An attacker or another compromised process modifies `~/.openclaw/workspace/skills/feishu-cache-guardian/scripts/check-and-fix.js`. 4. At the next scheduled time or system boot, OpenClaw executes the modified script automatically. 5. The substituted code runs with the permissions of the account or service responsible for the scheduled task. ### Impact Assessment The pers ...[truncated 513 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace recurring and boot-time execution with an explicit, one-time command run after a verified OpenClaw upgrade. 2. Prefer a supported OpenClaw configuration interface instead of repeatedly patching installed source code. 3. If scheduling is operationally required: - Execute an immutable or administrator-owned script rather than one in a user-writable workspace. - Verify the script's cryptographic hash or signature before every invocation. - Restrict write permissions on the script and its parent directories. - Run the task under a dedicated least-privileged service account. - Record every execution and modification in an audit log. 4. Document commands for inspecting and removing the registered tasks. 5. Require explicit user confirmation before installing any recurring or boot-time task. ]]>
