T06 · System Persistence
- Location
INSTALL.md:216- Finding
Persistent Background Execution Through Windows Task Scheduler
- Content
View full analysis
Vulnerability Details
File Location:
INSTALL.md:216-221
Vulnerability Type: Cross-session scheduled-task persistence
Risk Level: HighVulnerable Code
bat **Opțiunea A: Task Scheduler (Windows)** # Creează un task care rulează la fiecare 2 minute schtasks /create /tn "ImmortalBrainHeartbeat" /tr "python D:\OpenClaw_Setup\skills\immortal-brain\scripts\brain_service.py heartbeat" /sc minute /mo 2Technical Analysis
The installation guide instructs users to register a Windows scheduled task that invokes the Skill every two minutes. The task survives terminal closure, logout, and subsequent sessions, giving the Skill persistent background execution under the account used to register it.
Continuous operation is related to the declared heartbeat functionality, and the mechanism is presented as optional. However, operating-system-level persistence is not the minimum privilege necessary because OpenClaw's existing heartbeat mechanism is also documented as the recommended option. The scheduled task increases the execution scope beyond an individual Skill invocation.
The uninstallation procedure removes the Skill and workspace files but does not delete the scheduled task. Consequently, nominal uninstallation may leave a persistent scheduler entry that repeatedly attempts to execute the removed or subsequently replaced script path.
The command also invokes
pythonthrough PATH rather than using an absolute, trusted interpreter path. A changed PATH resolution context could cause an unintended executable to run. The scheduled action uses an absolute script location, but the guide does not validate ownership or permissions on that path.Attack Path
- A user follows the optional Task Scheduler installation instructions.
- Windows creates
ImmortalBrainHeartbeatunder the registering user's scheduler context. - The task invokes
brain_service.py heartbeatevery two minutes across sessions. - Each invocation reads and modifies ...[truncated 1239 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove scheduled-task creation from the default installation flow and retain OpenClaw's native heartbeat mechanism as the default.
- Require explicit, informed opt-in before creating operating-system-level persistence. Clearly state:
- How often the task runs.
- Which account it runs as.
- Which files it accesses.
- How to disable and remove it.
- Add the following cleanup command to the uninstallation procedure:
bat schtasks /delete /tn "ImmortalBrainHeartbeat" /f- Use a fully qualified, trusted Python executable instead of resolving
pythonthrough PATH:
bat schtasks /create /tn "ImmortalBrainHeartbeat" ^ /tr "\"C:\Path\To\Trusted\python.exe\" \"D:\OpenClaw_Setup\skills\immortal-brain\scripts\brain_service.py\" heartbeat" ^ /sc minute /mo 2- Run the task using a dedicated least-privileged account where feasible. Do not request administrator or SYSTEM privileges.
- Validate that the script and its parent directories are writable only by trusted users.
- Provide a separate status command that reports whether the scheduled task exists.
- Use a less aggressive interval unless two-minute execution is operationally required, and implement locking to prevent overlapping runs.
- Ensure uninstallation removes all persistence before deleting the script so the scheduler cannot target a stale or repurposed path.
