T06 · System Persistence
Error
- Location
- scripts/setup_daily_summary_cron.py:143
- Finding
- Recurring Cross-Session Agent Jobs Create System Persistence## Vulnerability Details **File Location**: `scripts/setup_daily_summary_cron.py`, lines 143-160 **Vulnerability Type**: T06: System Persistence **Risk Level**: High ```python cron_command = ( f'openclaw cron add ' f'--name "Daily Summary - {agent_id}" ' f'--cron "30 23 * * *" ' f'--tz "{timezone}" ' f'--session isolated ' f'--agent {agent_id} ' f'--message "{message}" ' f'--announce' ) result = run_openclaw_command(cron_command) if result and result.returncode == 0: print(f"✓ Daily Summary - {agent_id} created successfully") return True else: print(f"✗ Failed to create cron job for {agent_id}") if result: print(f"Error: {result.stderr}") return False ``` ### Technical Analysis The script invokes `openclaw cron add` to install a job that runs every day at 23:30. The job survives termination of the setup script and repeatedly starts an isolated agent session with instructions to inspect previous activity and write to the agent's persistent diary. The main routine applies this operation to every agent returned by `openclaw agents list --json`. Although the documented purpose of the Skill discloses scheduled execution, the implementation creates persistent, cross-session behavior and does not require confirmation for each affected agent. It also lacks an automatic expiration period or an integrated removal operation. ### Attack Path 1. A user runs `setup_daily_summary_cron.py`. 2. The script enumerates all configured OpenClaw agents and their workspaces. 3. It checks existing cron jobs using `openclaw cron list --json`. 4. For each agent not recognized as configured, it executes `openclaw cron add`. 5. The newly registered job remains active after the setup process exits. 6. At 23:30 every day, OpenClaw starts an isolated session for the affected agent and supplies the configured diary-writing instruction. 7. This continues inde ...[truncated 708 chars]
- Remediation
- ## Remediation Suggestions 1. Require explicit confirmation before creating any scheduled job and obtain separate approval for each affected agent. 2. Support an allowlist or command-line selection instead of configuring every discovered agent by default. 3. Print the exact schedule, agent, workspace, and message before installation. 4. Provide a corresponding uninstall operation that reliably identifies and removes every job created by this Skill. 5. Consider an expiration date, bounded execution count, or one-shot mode as the default behavior. 6. Assign a stable Skill-specific identifier to each generated job so that auditing and removal do not depend on message-text matching. 7. Document how users can list, disable, and remove the persistent jobs using the OpenClaw CLI.
