T06 · System Persistence
- Location
scripts/setup_cron.sh:65- Finding
Persistent Scheduled Task Enables Autonomous X Account Posting
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_cron.sh:65-77; additional example atexamples/cron_command.txt:2-9
Vulnerability Type: Persistent scheduled task with automatic posting privileges
Risk Level: HighVulnerable 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 listexamples/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-deliverTechnical 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
View remediation
Remediation Suggestions
- Make scheduled execution draft-only by default and omit
--postfrom the generated cron message. - Require a separate explicit option, such as
--enable-scheduled-posting, before adding--post. - Display the exact schedule and command, explain that it persists across sessions, and require interactive confirmation before registration.
- Add an approval gate for every generated tweet so scheduled runs cannot publish without user review.
- Document and provide a safe command or helper to list and remove the installed scheduled task.
- Use narrowly scoped X credentials and restrict them to only the permissions required for posting.
- Clearly document the task name, profile, schedule, timezone, notification behavior, credential requirements, and persistence implications.
- Consider enabling execution notifications rather than using
--no-deliver, allowing users to detect unexpected scheduled activity. - Protect the scheduled script and workspace against unauthorized modification because the persistent task will execute future versions of the referenced pipeline.
- Make scheduled execution draft-only by default and omit
