T06 · System Persistence
Error
- Location
- SKILL.md:82
- Finding
- Persistent Unattended Execution Through Cron or Heartbeat Tasks## Vulnerability Details **File Location**: `SKILL.md`, lines 82-96 **Vulnerability Type**: Cross-session scheduled execution **Risk Level**: High ### Vulnerable Code ```markdown ### Step 5: Configure Daily Cron Task Use cron or heartbeat to configure daily task: **Method A: Cron Task** ```bash # Run daily at UTC 1:00 (9:00 Beijing time) openclaw cron add "0 1 * * *" "Daily Learning Diary" "Read latest AI news, track GitHub stars, generate report and push to OpenClaw-Diary repo" ``` **Method B: Heartbeat Task** Add to HEARTBEAT.md: ```markdown ## Daily Learning Report - Research latest AI/tech/politics news - Track GitHub repo stars growth (if user has repos) - Generate report in user's language - Push to OpenClaw-Diary ``` ``` ### Technical Analysis The Skill instructs the Agent to create a recurring cron task or add durable instructions to `HEARTBEAT.md`. Both approaches cause behavior to continue after the original Skill invocation has ended. The scheduled activity includes external network research, content generation, repository modification, and publication. The instructions do not require approval before each execution or publication, constrain the external sources that may influence generated content, define an expiration time, or provide a command for removing the persistent task. The heartbeat mechanism additionally stores behavioral instructions in persistent Agent state. Although this persistence supports the advertised automation feature, it creates an unattended execution channel that survives the current session. ### Attack Path 1. A user invokes the Skill to configure the diary. 2. The Agent registers the supplied cron task or writes the instructions into `HEARTBEAT.md`. 3. The task continues running in later sessions without requiring a new Skill invocation. 4. Each run retrieves information from external sources and generates repository content. 5. The generated content ...[truncated 819 chars]
- Remediation
- ## Remediation Suggestions - Require explicit, informed confirmation immediately before creating the cron entry or modifying `HEARTBEAT.md`. - Perform a one-time preview run by default and show the exact content, destination repository, schedule, and permissions before enabling recurring execution. - Require approval before each publication unless the user separately opts into unattended publishing. - Restrict external research to an explicit allowlist of trusted sources. - Pin the destination repository and branch instead of allowing scheduled instructions to select arbitrary destinations. - Run the task with a repository-scoped credential and a minimally privileged execution identity. - Set an expiration time or maximum number of runs by default. - Document how to inspect, disable, and remove both cron and heartbeat configurations. - Log each execution and notify the user whenever content is generated or pushed.
