Back to skill

Security audit

OpenClaw Windows Fix Scheduled Task Idle-Kill Bug Patch

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Windows task fix, but it asks users to run an administrator batch command that force-replaces a persistent elevated scheduled task without enough scoping or safeguards.

Review this before installing on Windows. Prefer the manual Task Scheduler edits or a narrowly scoped script that backs up the existing task, verifies it is the expected OpenClaw task, changes only the needed idle and restart settings, avoids /rl HIGHEST unless required, and confirms the gateway command path is trusted and protected.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T06 · System Persistence

Error
Location
SKILL.md:48
Finding
Elevated Logon Persistence Executes a Mutable User-Profile Script<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:48-54` and duplicated in `README.md:39-45` **Vulnerability Type**: Scheduled-task persistence, excessive privileges, and unsafe executable path **Risk Level**: High ```batch REM Delete the old task schtasks /delete /tn "OpenClaw Gateway" /f 2>nul REM Create corrected task (runs at logon, no idle kill) schtasks /create /tn "OpenClaw Gateway" /tr "cmd /c cd /d \"%USERPROFILE%\.openclaw\" && gateway.cmd" /sc ONLOGON /rl HIGHEST /f ``` ### Technical Analysis The documented batch commands forcibly delete the existing `OpenClaw Gateway` scheduled task and recreate it with an `ONLOGON` trigger and the `HIGHEST` run level. This establishes execution that persists across sessions and requests the highest privileges available to the task principal. The task launches `gateway.cmd` indirectly through `cmd.exe` from `%USERPROFILE%\.openclaw`. The documentation does not validate the script's owner, access-control list, signature, or hash. Because a user-profile location is commonly writable by the account and potentially by processes operating under that account, any actor able to replace or alter `gateway.cmd` can influence what the scheduled task executes at the next logon. This design exceeds the minimum privileges necessary for the declared purpose. Correcting idle termination only requires changing the existing task's idle-related settings. It does not inherently require deleting the task, introducing a new logon trigger, requesting the highest run level, or launching a mutable batch file through a command interpreter. Forced replacement also discards the existing task definition, including its principal, action, conditions, access controls, failure behavior, and other security settings. The documentation claims that the replacement restarts on failure and operates regardless of battery state, but the provided `schtasks /create` command does not explicitly configure those properties. ### Attack Path ...[truncated 1931 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not delete and recreate the task merely to correct idle behavior. Modify only the required idle, execution-limit, battery, and failure-recovery properties of the existing task. 2. Preserve and review the existing task's principal, action, trigger, access-control descriptor, and other settings before applying changes. Export a backup of the task definition first. 3. Remove `/rl HIGHEST` unless documented functionality demonstrably requires elevation. Use the least-privileged dedicated account or standard user context sufficient to run the gateway. 4. Avoid `cmd.exe` and mutable batch files where possible. Configure the task to invoke the intended executable directly using an absolute path. 5. Store the executable or script in an administrator-protected installation directory rather than a broadly mutable user-profile path. 6. Restrict file and directory ACLs so only the trusted installer and required service identity can modify the launched program. 7. Verify the launched artifact's digital signature or cryptographic hash before registration and execution. 8. Explicitly configure and verify restart-on-failure and battery behavior instead of claiming settings that the supplied command does not establish. 9. Require explicit user confirmation before replacing an existing task, and abort if the existing task's principal or action differs from the expected trusted configuration. 10. Provide an uninstall or rollback procedure that restores the backed-up task definition and removes any persistence introduced by the fix. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo.

REM Delete the old task
schtasks /delete /tn "OpenClaw Gateway" /f 2>nul

REM Create corrected task (runs at logon, no idle kill)
schtasks /create /tn "OpenClaw Gateway" /tr "cmd /c cd /d \"%USERPROFILE%\.openclaw\" && gateway.cmd" /sc ONLOGON /rl HIGHEST /f
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo.

REM Delete the old task
schtasks /delete /tn "OpenClaw Gateway" /f 2>nul

REM Create corrected task (runs at logon, no idle kill)
schtasks /create /tn "OpenClaw Gateway" /tr "cmd /c cd /d \"%USERPROFILE%\.openclaw\" && gateway.cmd" /sc ONLOGON /rl HIGHEST /f
Confidence
84% confidence
Finding
The script force-deletes and recreates a scheduled task at high privilege using a fixed task name, which can overwrite an existing legitimate task without validation or backup. Because the README instructs users to manually create and run a .bat file as Administrator, the skill encourages privileged system modification with minimal safeguards, increasing the chance of destructive misconfiguration or unintended persistence.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The README promises that the fix disables idle-stop behavior, restarts on failure, and handles power conditions, but the provided batch command only recreates a task with an ONLOGON trigger and highest privileges. This mismatch can mislead administrators into believing resilience and task-condition hardening were applied when they were not, leaving the service unreliable and potentially easier to disrupt through normal idle/task settings.

Intent-Code Divergence

Low
Confidence
88% confidence
Finding
The inline comment says the script creates a 'corrected task' that fixes idle-kill behavior, but the command shown does not explicitly configure those conditions. Misleading comments in administrative scripts can cause operators to trust an incomplete fix and skip manual verification, increasing the chance of persistent misconfiguration.

Scope Creep

Low
Category
Excessive Agency
Content
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Scope Creep

Low
Category
Excessive Agency
Content
**USE AT YOUR OWN RISK.**

- The author(s) are NOT liable for any damages, losses, or consequences arising from 
  the use or misuse of this software — including but not limited to financial loss, 
  data loss, security breaches, business interruption, or any indirect/consequential damages.
- This software does NOT constitute financial, legal, trading, or professional advice.
- Users are solely responsible for evaluating whether this software is suitable for
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Static analysis

No suspicious patterns detected.