T06 · System Persistence
Error
- Location
- SKILL.md:39
- Finding
- Persistent Autonomous Execution Through a Recurring Cron Job<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:39-47`, `SKILL.md:55-67`, `references/agent-guide.md:70-94` **Vulnerability Type**: Persistent scheduled task **Risk Level**: Critical ### Vulnerable Code ```bash clawdbot cron add \ --name "Daily Auto-Update" \ --cron "0 4 * * *" \ --tz "America/Los_Angeles" \ --session isolated \ --wake now \ --deliver \ --message "Run daily auto-updates: check for Clawdbot updates and update all skills. Report what was updated." ``` The recommended configuration further enables automatic recovery of missed executions: ```json { "schedule": { "expr": "0 4 * * *", "kind": "cron", "tz": "Asia/Shanghai" }, "missedRunPolicy": "run-immediately", "payload": { "kind": "agentTurn", "message": "...", "timeoutSeconds": 600 } } ``` The Agent guide supplies a more extensive persistent cron payload: ```bash clawdbot cron add \ --name "Daily Auto-Update" \ --cron "0 4 * * *" \ --tz "America/Los_Angeles" \ --session isolated \ --wake now \ --deliver \ --message "Run the daily auto-update routine: 1. Check and update Clawdbot: - For npm installs: npm update -g clawdbot@latest - For source installs: clawdbot update - Then run: clawdbot doctor --yes 2. Update all skills: - Run: clawdhub update --all 3. Report back with: - Clawdbot version before/after - List of skills that were updated (name + old version → new version) - Any errors encountered Format the summary clearly for the user." ``` ### Technical Analysis The Skill instructs an Agent to create a recurring scheduled task that survives the originating Skill invocation and Agent session. The task launches isolated Agent turns that perform state-changing update operations. The `missedRunPolicy` value of `run-immediately` causes an execution to occur when the Gateway returns after being unavailable, while `--wake now` further increases autonomous availability. Although scheduled upda ...[truncated 1974 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Default to update notifications or dry-run checks rather than unattended installation. 2. Require explicit, informed user confirmation immediately before creating a persistent cron task. 3. Display the exact schedule, payload, execution account, update sources, and removal command before installation. 4. Do not enable `missedRunPolicy: "run-immediately"` unless the user specifically requests it. 5. Replace the natural-language cron payload with a fixed, locally stored, reviewed script whose integrity is verified before execution. 6. Restrict the scheduled task to checking for updates; require separate approval before applying each proposed version. 7. Run the task under a dedicated least-privileged service account with write access only to necessary package and Skill directories. 8. Add a verified removal procedure and confirm that the cron entry has actually been deleted when automatic updates are disabled. 9. Record immutable audit events for task creation, modification, execution, and removal. 10. Apply execution locking so missed and scheduled runs cannot overlap. ]]>
