T06 · System Persistence
Error
- Location
- scripts/setup_cron.sh:65
- Finding
- Persistent Scheduled Task Enables Autonomous X Account Posting## Vulnerability Details **File Location**: `scripts/setup_cron.sh:65-77`; additional example at `examples/cron_command.txt:2-9` **Vulnerability Type**: Persistent scheduled task with automatic posting privileges **Risk Level**: High ### Vulnerable Code `scripts/setup_cron.sh:65-77`: ```bash # Escape single quotes defensively for the command text passed to cron. SAFE_QUERIES="${QUERIES//\'/\'\\\'\'}" MESSAGE="Run: python3 skills/kiro-x-hot-publisher/scripts/x_hot_pipeline.py --queries '$SAFE_QUERIES' --batch-size $BATCH --post" echo "[x-hot] using node: $NODE22_BIN" "$NODE22_BIN" openclaw.mjs --profile "$PROFILE" cron add \ --name "$JOB_NAME" \ --cron "$CRON_EXPR" \ --tz "$TZ_NAME" \ --session isolated \ --message "$MESSAGE" \ --no-deliver echo "[x-hot] cron job created" "$NODE22_BIN" openclaw.mjs --profile "$PROFILE" cron list ``` `examples/cron_command.txt:2-9`: ```bash # Daily 09:00 Asia/Shanghai, run pipeline and post 1 tweet openclaw cron add \ --name "Daily Kiro X Hot Publisher" \ --cron "0 9 * * *" \ --tz "Asia/Shanghai" \ --session isolated \ --message "Run: python3 skills/kiro-x-hot-publisher/scripts/x_hot_pipeline.py --queries \"AI,OpenAI,DeepSeek,Claude,Gemini\" --batch-size 10 --post" \ --no-deliver ``` ### Technical Analysis The setup script registers a recurring OpenClaw cron job that survives the setup process and executes in future sessions. The stored command unconditionally includes `--post`, causing each scheduled invocation to generate and publish a tweet through the X API. Although scheduled publishing is part of the Skill's declared optional functionality, the helper does not default to draft-only operation or separately require explicit authorization for recurring publication. Running the helper therefore creates persistent autonomous behavior with the authority to publish using the X OAuth credentials available to the scheduled session. ...[truncated 1886 chars]
- Remediation
- ## Remediation Suggestions 1. Make scheduled execution draft-only by default and omit `--post` from the generated cron message. 2. Require a separate explicit option, such as `--enable-scheduled-posting`, before adding `--post`. 3. Display the exact schedule and command, explain that it persists across sessions, and require interactive confirmation before registration. 4. Add an approval gate for every generated tweet so scheduled runs cannot publish without user review. 5. Document and provide a safe command or helper to list and remove the installed scheduled task. 6. Use narrowly scoped X credentials and restrict them to only the permissions required for posting. 7. Clearly document the task name, profile, schedule, timezone, notification behavior, credential requirements, and persistence implications. 8. Consider enabling execution notifications rather than using `--no-deliver`, allowing users to detect unexpected scheduled activity. 9. Protect the scheduled script and workspace against unauthorized modification because the persistent task will execute future versions of the referenced pipeline.
