T06 · System Persistence
- Location
scripts/setup_daily_summary_cron.py:143- Finding
Recurring Cross-Session Agent Jobs Create System Persistence
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_daily_summary_cron.py, lines 143-160
Vulnerability Type: T06: System Persistence
Risk Level: Highpython 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 FalseTechnical Analysis
The script invokes
openclaw cron addto 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
- A user runs
setup_daily_summary_cron.py. - The script enumerates all configured OpenClaw agents and their workspaces.
- It checks existing cron jobs using
openclaw cron list --json. - For each agent not recognized as configured, it executes
openclaw cron add. - The newly registered job remains active after the setup process exits.
- At 23:30 every day, OpenClaw starts an isolated session for the affected agent and supplies the configured diary-writing instruction.
- This continues inde ...[truncated 708 chars]
- A user runs
- Remediation
View remediation
Remediation Suggestions
- Require explicit confirmation before creating any scheduled job and obtain separate approval for each affected agent.
- Support an allowlist or command-line selection instead of configuring every discovered agent by default.
- Print the exact schedule, agent, workspace, and message before installation.
- Provide a corresponding uninstall operation that reliably identifies and removes every job created by this Skill.
- Consider an expiration date, bounded execution count, or one-shot mode as the default behavior.
- Assign a stable Skill-specific identifier to each generated job so that auditing and removal do not depend on message-text matching.
- Document how users can list, disable, and remove the persistent jobs using the OpenClaw CLI.
