T06 · System Persistence
- Location
FIXES.md:89- Finding
Optional Scheduled Task Enables Persistent Recurring Execution Without Adequate Hardening
- Content
View full analysis
Vulnerability Details
File Location:
FIXES.md, lines 89-93
Vulnerability Type: Windows scheduled-task persistence
Risk Level: MediumVulnerable Code
powershell ### Cron定时任务 ```powershell # 添加到计划任务中,每天9:00执行 schtasks /create /tn "OpenClaw API检查" /tr "powershell -Command \"cd 'C:\Users\Administrator\.openclaw\workspace\skills\windows-api-monitor\scripts'; python auto_checker.py --simple --both\"" /sc DAILY /st 09:00Technical Analysis
The documentation instructs the user to register a Windows scheduled task that survives the current Skill invocation and executes every day. Scheduled execution is relevant to the declared monitoring functionality, but it is not necessary for ordinary on-demand usage and therefore must be explicitly optional and hardened according to least-privilege principles.
The scheduled action has the following security weaknesses:
- It uses a path under the
Administratorprofile, suggesting that the task may be installed or run from a privileged account. - It invokes both
powershellandpythonwithout absolute, trusted executable paths. Their resolution therefore depends on the task's environment and executable search path. - It repeatedly executes
auto_checker.pyfrom a mutable workspace directory without checking its integrity, owner, or access-control list. - The PowerShell process is not constrained with options such as
-NoProfileand-NonInteractive. Profile loading can introduce additional code into scheduled execution. - No removal command, task principal, privilege level, execution timeout, or post-installation verification is documented.
The project does not automatically execute this command, and the reviewed Python scripts do not independently install a scheduled task. Exploitation therefore requires the user to follow the optional documentation and create the task.
Attack Path
- A user follows
FIXES.mdand executes the supplied `s ...[truncated 1475 chars]
- It uses a path under the
- Remediation
View remediation
Remediation Suggestions
-
Clearly label scheduled-task creation as an explicit, optional action requiring informed user consent. Do not create it during ordinary Skill execution.
-
Run the task under a dedicated, non-administrative account with only read access to the required OpenClaw logs and write access to a dedicated report directory.
-
Use absolute paths for PowerShell, Python, and the script, for example:
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe- A verified absolute path to
python.exe - An absolute path to
auto_checker.py
-
Invoke PowerShell with
-NoProfile -NonInteractiveto prevent profile-based code loading and unintended interaction. -
Restrict the Skill directory's ACL so that untrusted users cannot modify the scheduled script or its parent directories.
-
Verify script integrity before recurring execution, such as by using signed scripts or a securely stored expected hash.
-
Explicitly configure the task principal, non-elevated run level, execution timeout, failure handling, and conditions through a reviewed task definition.
-
Document task inspection and removal commands, such as:
powershell schtasks /query /tn "OpenClaw API检查" schtasks /delete /tn "OpenClaw API检查" /f -
Prefer a user-controlled foreground monitoring process when continuous execution is not required.
-
