T06 · System Persistence
Error
- Location
- references/operations.md:106
- Finding
- SYSTEM-level scheduled-task persistence exceeds functional requirements<![CDATA[ ## Vulnerability Details **File Location**: `references/operations.md:106-111` **Vulnerability Type**: Privileged scheduled-task persistence **Risk Level**: High ### Vulnerable Code or Configuration ```text ## 5. Windows 计划任务配置(ssq_run_v8.bat + schtasks) > ⚠️ 发布包不含 ssq_run_v8.bat(SkillHub 等平台禁用 .bat 等可执行脚本)。 > 下面的 bat 仅适用于本机 Windows 部署。 - 任务名 SSQ_V1_Smart: schtasks /create /tn SSQ_V1_Smart /tr "绝对路径\ssq_run_v8.bat" /sc weekly /d MON,WED,SAT /st 20:10 /ru SYSTEM /rl highest - bat 第 10 行 /ru SYSTEM,确保无论登录都跑;含 WakeToRun / RestartOnFailure / StartWhenAvailable。 ``` The package does not directly execute `schtasks /create`, but its official operational instructions explicitly direct users to install a recurring task under the Windows `SYSTEM` account with the highest run level. ### Technical Analysis Lottery analysis, public-data retrieval, and HTML report generation do not require administrative or `SYSTEM` privileges. A current-user scheduled task is sufficient if optional automatic report generation is desired. The documented command creates a persistent execution mechanism that: - Survives the Skill invocation and user logout. - Runs whether or not an interactive user is logged in. - Executes the batch file and all downstream Python scripts as `SYSTEM`. - Uses `RestartOnFailure` and `StartWhenAvailable`, increasing persistence. - Gives all future versions or modified copies of invoked scripts machine-level privileges. This violates least-privilege principles and significantly amplifies other filesystem and cross-profile behaviors in the project. ### Attack Path 1. A user follows the Skill's Windows deployment instructions. 2. The user runs the documented `schtasks /create` command with administrative authorization. 3. Windows registers `SSQ_V1_Smart` to execute as `SYSTEM` at recurring times. 4. The task invokes `ssq_run_v8.bat`, which launches the report-generation pipeline. 5. All scripts, network processing, profile enumeration, databa ...[truncated 541 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the `SYSTEM` and highest-run-level deployment instructions. 2. Do not enable scheduling by default or represent it as an integral part of report generation. 3. If scheduling is offered, require explicit informed user consent and create the task under the current user without elevation. 4. Use a narrowly scoped output directory owned by that user. 5. Do not enable `WakeToRun`, automatic restart, or execution while logged out unless the user separately opts into each behavior. 6. Provide documented removal and status commands for every scheduled task. 7. Keep scheduling outside the core Skill package so ordinary report generation never requires administrative privileges. ]]>
