T06 · System Persistence
Error
- Location
- SKILL.md:139
- Finding
- Persistent Execution Through Windows Task Scheduler<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 139–161 **Vulnerability Type**: `T06: System Persistence` **Risk Level**: High ### Vulnerable Code ```vbs ### Step 6: Automate with Task Scheduler (Windows) Create `guardian.vbs` for zero-flash auto-restart: ```vbs ' guardian.vbs — starts competition if not running Set oShell = CreateObject("WScript.Shell") Set oFS = CreateObject("Scripting.FileSystemObject") lockFile = "C:\Users\User\.openclaw\workspace\bybit-trading\competition.lock" If oFS.FileExists(lockFile) Then pid = Trim(oFS.OpenTextFile(lockFile,1).ReadLine()) ' Check if PID is alive (WMI) strCmd = "powershell -Command ""(Get-Process -Id " & pid & " -ErrorAction SilentlyContinue) -ne $null""" result = oShell.Run(strCmd, 0, True) If result = 0 Then WScript.Quit ' Still running End If ' Start competition oShell.Run "cmd /c node C:\Users\User\.openclaw\workspace\bybit-trading\competition_manager_okx.js >> competition.log 2>&1", 0, False ``` Register in Task Scheduler: every 2 minutes, run as user, run whether logged in or not. ``` ### Technical Analysis The Skill explicitly directs users to create a Windows scheduled task that runs every two minutes, including while the user is logged out. The guardian launches or relaunches `competition_manager_okx.js`, establishing cross-session persistence for the trading process. Persistent execution may be operationally useful for a continuous trading service, but it exceeds the minimum privileges necessary to demonstrate, test, or manually run a paper-trading Skill. The risk is amplified because the JavaScript file being launched is not included in the audited project. Its behavior, network destinations, credential handling, and trading controls therefore cannot be verified. The process executes with the permissions of the account configured for the scheduled task. It may consequently inherit access to the workspace, user files, environment configuration, and trade-enabled O ...[truncated 1498 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not configure cross-session scheduled execution by default. Use explicit, interactive startup for demo and evaluation workflows. 2. If continuous operation is essential, ship and audit every script that the scheduled task executes before recommending installation. 3. Require explicit, informed user consent before creating persistence and clearly distinguish demo operation from live trading. 4. Run the task under a dedicated, non-administrative service account with access limited to the required application directory and demo credentials. 5. Configure the task to execute a fixed, integrity-verified application path rather than code that can be replaced by ordinary workspace modifications. 6. Avoid hidden execution during setup and provide observable logs, health status, and failure notifications. 7. Document exact commands for disabling and deleting the scheduled task. 8. Do not permit the persistent process to access live-trading credentials by default. Use demo-only API keys with narrowly scoped permissions. 9. Protect application files and secrets using restrictive filesystem ACLs, and rotate credentials if the persisted executable changes unexpectedly. 10. Consider a supervised service with explicit installation, signed artifacts, restricted privileges, and integrity validation instead of an ad hoc recurring task. ]]>
