T06 · System Persistence
Warning
- Location
- SKILL.md:67
- Finding
- Optional Crontab Creates Persistent Unattended Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:67-73` **Vulnerability Type**: `T06: System Persistence` **Risk Level**: Medium ### Vulnerable Code ```markdown ### 5. Set up periodic sync (optional) Add a system crontab to keep contacts fresh (e.g., weekly Monday 7am): ```bash 0 7 * * 1 python3 /path/to/scripts/sync_feishu_contacts.py ~/.openclaw/openclaw.json my_app ~/workspace/USER.md ``` ``` ### Technical Analysis The documentation recommends registering the synchronization script in the system crontab. Although this action is optional, transparent, and not performed automatically by the Skill, it establishes recurring execution that survives the initial Skill run. Every scheduled invocation reads Feishu application credentials from the OpenClaw configuration, authenticates to Feishu, retrieves the accessible contact directory, and rewrites `USER.md`. Persistent scheduling is not required for the core on-demand contact synchronization function and therefore exceeds the minimum execution lifetime necessary to perform a single synchronization. The scheduled command also references a script by filesystem path without an integrity check. If that script is subsequently replaced or modified, cron will execute the changed content automatically under the account that owns the crontab. ### Attack Path 1. The user follows the optional setup instructions and installs the provided cron entry. 2. The cron job runs weekly under the user's account without interactive confirmation. 3. An attacker who later obtains write access to the referenced script path replaces or modifies the synchronization script. 4. At the next scheduled time, cron executes the modified script automatically. 5. The malicious replacement inherits the cron user's filesystem and network access, including potential access to the OpenClaw configuration and `USER.md`. This path requires the attacker to obtain write access to the scheduled script or its containing directory. The c ...[truncated 899 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Prefer explicit, user-initiated synchronization because the core functionality does not require persistent execution. - If periodic synchronization is necessary, use an application-scoped scheduler instead of a general system crontab. - Run the task under a dedicated least-privileged account that can read only the required configuration and modify only the intended contact data file. - Place the script in a directory that unprivileged or unrelated processes cannot modify. - Verify the script's integrity before each scheduled execution, such as by checking a pinned cryptographic hash or using a signed deployment artifact. - Add bounded execution time, failure logging, and notifications for unexpected changes. - Document how to list, disable, and remove the scheduled task. - Avoid scheduling the task as `root` or another privileged service account. ]]>
