T06 · System Persistence
Error
- Location
- SKILL.md:74
- Finding
- Persistent Autonomous Execution Through Scheduled Heartbeats<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 74-77 and 130-133 **Vulnerability Type**: Scheduled-task persistence **Risk Level**: High ### Vulnerable Code ```markdown ## Cron Setup Always use CLI, never edit openclaw.json: ```bash openclaw cron add --name "<Project> Pipeline" --agent <agent-id> --every 30m --message "Heartbeat: lee HEARTBEAT.md y ejecuta siguiente step" ``` ``` ```markdown 2. **HEARTBEAT.md siempre en workspace** — nunca en repo 3. **HEARTBEAT es immutable** — locked con `chflags uchg` 4. **Crons vía CLI** — `openclaw cron add`, nunca editar openclaw.json ``` ### Technical Analysis The Skill directs the agent to create a recurring OpenClaw cron job that executes every 30 minutes. The scheduled message instructs the agent to read `HEARTBEAT.md` and execute the next pipeline step. It also requires that the controlling heartbeat file be made immutable with `chflags uchg`. This creates cross-session persistence: pipeline activity can continue after the original Skill invocation and in the absence of an active user session. Making the instructions immutable also hinders ordinary modification or remediation. The scheduled process operates with the permissions and tool access of the configured OpenClaw agent. No expiration, maximum execution count, explicit per-run approval, or cleanup procedure is specified. ### Attack Path 1. A user or agent follows the Skill and creates `HEARTBEAT.md`. 2. The file is locked with `chflags uchg`, preventing ordinary modification. 3. The prescribed `openclaw cron add` command installs a recurring 30-minute job. 4. Each invocation causes the configured agent to read the heartbeat instructions and process a pipeline step. 5. The activity continues across sessions until the cron entry is explicitly removed and the file lock is cleared. 6. If the mutable pipeline is later modified maliciously, the persistent scheduler repeatedly provides an execution opportunity. ### Impact Assessment ...[truncated 455 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not create scheduled jobs automatically as part of Skill execution. - Require explicit, informed user approval before installing each cron entry. - Prefer bounded, one-time jobs with an expiration time or maximum execution count. - Keep `HEARTBEAT.md` user-editable; do not apply immutable filesystem flags. - Document exact cleanup commands for removing the cron entry and clearing any file flags. - Display every scheduled action and obtain confirmation before execution. - Restrict the scheduled agent to a dedicated least-privilege account and narrowly scoped tools. - Add an emergency disable mechanism that does not depend on editing an immutable file. ]]>
