T06 · System Persistence
- Location
- SKILL.md:114
- Finding
- Recurring Agent Task Creates Cross-Session Persistence<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:114-136` and `README.md:119-141` **Vulnerability Type**: T06: System Persistence **Risk Level**: High ### Complete Code Snippet ```bash cron add --job '{ "name": "memory-compact Daily Backup", "schedule": { "kind": "cron", "expr": "30 6 * * *", "tz": "Asia/Shanghai" }, "payload": { "kind": "agentTurn", "message": "Run /root/.openclaw/workspace/skills/memory-compact/wrapper.py to process the daily memory backup", "timeoutSeconds": 60 }, "sessionTarget": "isolated", "enabled": true, "delivery": { "mode": "announce" } }' ``` The displayed snippet is an English rendering of the operational cron configuration in both documentation files; the executable path, schedule, payload type, timeout, session target, and enabled state are unchanged. ### Technical Analysis The installation instructions direct the user to register an enabled OpenClaw cron job. Its `agentTurn` payload launches the Skill every day at 06:30 in the `Asia/Shanghai` time zone. Unlike a one-time Skill invocation, the scheduled task survives the current run and repeatedly creates new Agent turns. Those turns execute `wrapper.py`, which invokes `memory_backup.py` and grants it recurring access to workspace memory files. The persistence mechanism is disclosed in the documentation, but it remains a security-sensitive cross-session modification. The instructions do not provide a corresponding removal command, expiration policy, per-run approval requirement, or least-privilege limitation. ### Attack Path 1. A user installs the Skill and follows the cron setup instructions. 2. OpenClaw registers the enabled recurring `agentTurn` job. 3. The cron entry remains active after the installation session ends. 4. At each scheduled time, a new isolated Agent turn is initiated. 5. The turn runs `wrapper.py`, which launches `memory_backup.py`. 6. The process reads conversation-derived memory, modifies lo ...[truncated 629 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove automatic cron-registration instructions from the default installation workflow. 2. Require explicit, informed opt-in before creating any persistent scheduled task. 3. Show the exact schedule, executable, affected files, and execution privileges before confirmation. 4. Provide a documented command that disables and removes the cron job. 5. Consider expiration after a limited number of runs rather than indefinite persistence. 6. Prefer a narrowly scoped local scheduler that runs the Python program directly instead of creating autonomous Agent turns. 7. Require per-run approval before reading conversation memory or changing `MEMORY.md`. 8. Record each execution and memory modification in an auditable log. ]]>
