T06 · System Persistence
Warning
- Location
- SKILL.md:78
- Finding
- Persistent Scheduled Execution Without Script Integrity Controls## Vulnerability Details **File Location**: `SKILL.md`, lines 78-85 **Vulnerability Type**: System persistence through a cron task **Risk Level**: Medium **Vulnerable Code:** ```bash ## OpenClaw Automation (CRON) Use the provided script: # Every 15 minutes */15 * * * * /path/to/aicoo-skills/scripts/inbox-monitor-cron.sh >> /tmp/aicoo-inbox-monitor.log 2>&1 ``` ### Technical Analysis The skill directs the operator or agent to configure a cron entry that executes a script every 15 minutes. The scheduled task survives the individual skill invocation and continues running across user sessions, which constitutes system persistence. The referenced `scripts/inbox-monitor-cron.sh` file is not included in the audited project. Consequently, its behavior, provenance, integrity, permissions, and handling of the `AICOO_API_KEY` cannot be verified. The instructions also do not require an absolute trusted installation path, ownership validation, restrictive file permissions, or cryptographic integrity verification before scheduling the script. If the executable path or one of its parent directories is writable by an attacker, the scheduled command can become a recurring execution mechanism for attacker-controlled code. The cron job inherits the privileges and environment available to the account under which it is installed. ### Attack Path 1. An operator follows the skill instructions and adds the supplied entry to their crontab. 2. The placeholder is replaced with a path to an externally obtained or locally created `inbox-monitor-cron.sh` script. 3. An attacker supplies the missing script, compromises it after installation, or gains write access to the script path or a parent directory. 4. Cron invokes the modified script automatically every 15 minutes without requiring another skill invocation. 5. The attacker-controlled script executes persistently with the privileges of the cron owner and can access resources a ...[truncated 895 chars]
- Remediation
- ## Remediation Suggestions - Do not direct the agent to install a persistent scheduled task automatically. Require explicit, informed operator approval and display the exact command before installation. - Include the referenced script in the reviewed package so its complete behavior can be audited. - Use an absolute installation path under a trusted, non-world-writable directory. - Require the script and all parent directories to be owned by the intended account or administrator and not writable by untrusted users. - Pin and verify the script using a cryptographic checksum or signed release before registering the cron task. - Run the monitor under a dedicated least-privileged service account rather than a privileged or interactive user. - Supply the API credential through a restricted secret store or permission-controlled environment file; do not place it directly in the crontab or command line. - Add documented uninstall instructions that remove the cron entry and any associated state, logs, and credentials. - Prefer a sandboxed service mechanism with explicit filesystem, network, resource, and credential restrictions if persistent monitoring is genuinely required. - Store logs and state in a private directory with restrictive permissions instead of a shared `/tmp` location.
