T06 · System Persistence
- Location
scripts/install_cron.sh:8- Finding
Persistent OpenClaw Scheduled Task Without Lifecycle Controls
- Content
View full analysis
Vulnerability Details
File Location:
scripts/install_cron.sh, lines 8-25
Vulnerability Type: T06: System Persistence
Risk Level: HighVulnerable Code:
bash PROMPT_DIR="${HOME}/.openclaw/prompts" PROMPT_FILE="${PROMPT_DIR}/${NAME}.prompt" mkdir -p "${PROMPT_DIR}" cat > "${PROMPT_FILE}" <<PROMPT 使用 weibo-fresh-posts 技能。 要求: 1) 使用 browser 的 profile=openclaw、target=host 打开 https://weibo.com。 2) 抓取前必须点击左侧“最新微博”。 3) 按发帖时间写入 YYYY-MM-DD HH:mm,禁止使用抓取时间。 4) 发帖内容列必须写原始贴文正文,不能写成总结。 5) 若卡片正文被截断,进入原帖详情提取完整正文。 6) 抓取窗口为最近 ${WINDOW} 分钟。 7) 按原始链接去重,写入 ~/weibo-digest/YYYY-MM-DD.md。 PROMPT openclaw cron add \ --name "${NAME}" \ --every "${INTERVAL}" \ --session isolated \ --message "$(cat "${PROMPT_FILE}")" \ --timeout-seconds 240 \ --no-deliverTechnical Analysis
The installer creates a persistent prompt under
~/.openclaw/promptsand registers a recurring OpenClaw cron task. The scheduled task survives the installation process and continues launching isolated agent sessions at the configured interval.The recurring task operates the
openclawbrowser profile, which the documentation expects to be authenticated to Weibo. Although this persistence supports the advertised monitoring functionality and requires the user to run the installer, the project does not provide an uninstall mechanism, task expiration, execution-count limit, or confirmation that clearly presents the persistent resources before creating them.Attack Path
- The user follows the installation instructions and runs
scripts/install_cron.sh. - The script creates a prompt file under
~/.openclaw/prompts. - The script registers the prompt as a recurring OpenClaw cron task.
- OpenClaw subsequently launches isolated agent sessions at every configured interval.
- Each session accesses Weibo through the existing
openclawbrowser profile and writes collected data to the local digest.
...[truncated 734 chars]
- The user follows the installation instructions and runs
- Remediation
View remediation
Remediation Suggestions
- Require explicit confirmation immediately before registering the recurring task.
- Display the task name, interval, prompt path, browser profile, timeout, and exact command that will be persisted.
- Add a documented uninstall script that removes both the OpenClaw cron entry and its prompt file.
- Support an optional expiration time or maximum execution count.
- Detect an existing task with the same name and request confirmation before replacing or duplicating it.
- Document commands for listing, disabling, and deleting installed tasks.
- Use restrictive permissions for the prompt directory and file, such as directory mode
0700and file mode0600.
