T06 · System Persistence
Error
- Location
- SKILL.md:144
- Finding
- Privileged Boot Persistence Through Windows Task Scheduler## Vulnerability Details **File Location**: `SKILL.md`, lines 144–152 **Vulnerability Type**: Privileged scheduled-task persistence **Risk Level**: High ### Vulnerable Code ```powershell ### Option C: Windows Task Scheduler (Manual) ```powershell # Create auto-start task with 1-minute restart on failure schtasks /create /tn "OpenClaw Gateway" /tr "openclaw gateway start" /sc onstart /rl highest /f # Or use Task Scheduler GUI for finer restart policies ``` ``` ### Technical Analysis The command creates a scheduled task that survives reboots and executes whenever Windows starts. Persistence is consistent with the Skill's stated keepalive purpose, but `/rl highest` requests the highest available execution level without demonstrating that the gateway requires administrative privileges. The task action also invokes `openclaw` by name instead of using an absolute, verified executable path. Its eventual resolution can depend on the task environment and executable search configuration. If an attacker who already has local write access can replace the expected executable or influence how it is resolved, the persistent task could execute attacker-controlled code at an elevated level. This behavior therefore combines an intentional persistence mechanism with an avoidable privilege-boundary risk. ### Attack Path 1. A user follows the Skill and authorizes creation of the scheduled task. 2. Windows registers `OpenClaw Gateway` to execute at system startup with the highest available run level. 3. An attacker with sufficient local write access replaces the expected `openclaw` executable or causes the unqualified command to resolve to an attacker-controlled executable. 4. The computer starts or the task is otherwise triggered. 5. The attacker-controlled executable runs through the persistent task at its elevated execution level. ### Impact Assessment The task provides cross-reboot execution and may provide administrative ...[truncated 284 chars]
- Remediation
- ## Remediation Suggestions - Remove `/rl highest` unless a documented gateway operation strictly requires elevation. - Run the gateway under a dedicated, unprivileged service account with no interactive logon rights. - Use an absolute path to the verified `openclaw` executable rather than relying on command-name resolution. - Restrict write permissions on the executable, installation directory, task definition, and configuration files. - Prefer per-user startup registration when the gateway only serves the current user. - Display the exact task definition and privilege level before requesting user approval. - Provide and verify an explicit removal command, such as deleting the named scheduled task. - Configure bounded restart behavior to avoid uncontrolled restart loops.
