T06 · System Persistence
- Location
scripts/setup_cron.py:107- Finding
Persistent Recurring OpenClaw Jobs Installed Without Lifecycle Controls
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_cron.py:107-125
Additional Location:scripts/setup_cron.py:158-183
Vulnerability Type: Persistent scheduled-task installation
Risk Level: HighVulnerable Code
python def execute_openclaw_cron(job_name, cron_expr, message): current_channel = load_active_channel() try: current_user_id = load_user_id_for_channel(current_channel) args = [ 'openclaw', 'cron', 'add', '--name', job_name, '--cron', cron_expr, '--tz', CURRENT_TZ, '--session', 'isolated', '--wake', 'now', '--channel', current_channel, '--to', current_user_id, '--message', message, '--announce' ] result = subprocess.run(args, capture_output=True, text=True)The function is called by the main installation flow to create the following recurring jobs:
daily-recorder-assistant-morningwith schedule0 8 * * *daily-recorder-assistant-eveningwith schedule0 18 * * *
Technical Analysis
The setup script invokes
openclaw cron addto create two recurring scheduled jobs. These jobs remain registered after the script and invoking session terminate, wake isolated OpenClaw sessions, and announce messages to the channel and user identifier loaded from persistentstate.json.Scheduled reminders are related to the declared daily-recording functionality and installation is documented as a separate setup step. However, the persistence mechanism is not required for manual recording, analysis, or planning. It therefore exceeds the minimum privileges necessary for the Skill's core functionality unless the user explicitly opts into automated reminders.
The script checks whether similarly named jobs already exist, but it continues installation when they are found. Consequently, repeated execution c ...[truncated 1913 chars]
- Remediation
View remediation
Remediation Suggestions
- Keep manual operation as the default and require an explicit
--install-remindersoption. - Display the exact schedules, destination channel, destination user, and persistence implications before installation.
- Require interactive confirmation immediately before invoking
openclaw cron add, with a noninteractive confirmation flag for controlled automation. - Abort when matching jobs already exist unless the user supplies an explicit
--forceor--allow-duplicatesoption. - Record the exact job IDs returned by OpenClaw in a dedicated state structure after successful installation.
- Add an
--uninstallmode that removes only the exact job IDs created by this Skill. - Support optional expiration dates or bounded reminder counts rather than indefinite recurrence.
- Validate that the destination user ID is authorized and reject placeholder values such as unconfigured or pending authorization.
- Document removal commands directly beside installation instructions.
- Correct the initialization message that describes
setup_cron.pyas a system crontab mechanism; the reviewed implementation registers OpenClaw cron jobs instead.
- Keep manual operation as the default and require an explicit
