T09 · Insecure Skill Coding Practices
- Location
scripts/task_check.sh:39- Finding
Unsanitized Task Data Injected into Heartbeat Markdown Logs
- Content
View full analysis
/dev/null || echo "") if [ -n "$IN_PROGRESS_TASKS" ]; then echo "" >> "$LOG_FILE" echo "## 进行中的任务" >> "$LOG_FILE" while IFS='|' read -r task_id task_name due_date progress; do echo "" >> "$LOG_FILE" echo "### $task_id: $task_name" >> "$LOG_FILE" echo "- **截止日期:** $due_date" >> "$LOG_FILE" echo "- **当前进度:** $progress%" >> "$LOG_FILE" ``` ### Technical Analysis Values extracted from `tasks.json`, including `id`, `name`, `due_date`, and `progress`, are written directly to an agent-readable Markdown log without validation or escaping. An attacker who can create or modify a task can include line breaks, Markdown headings, links, HTML, or instruction-like content in these fields. The script also serializes fields with a literal pipe delimiter and parses them using `IFS='|'`. A pipe inside any task value can shift field boundaries and cause task attributes to be represented incorrectly. The resulting file is persistent under `~/.openclaw/workspace/.tasks/logs/` and is intended to be consumed during heartbeat reviews. Consequently, crafted content can be presented to an AI agent as if it were part of the trusted report. Shell command execution is not directly possible through this code because the expanded variables are quoted and are not passed to `eval` or a shell interpreter. ### Attack Path 1. The attacker gains the ability to add or modify an entry in `.tasks/tasks.json`. 2. The attacker places multiline Markdown or instruction-like content in a field such as `name`, for example a new heading followed by instructions directed at the reviewin ...[truncated 1066 chars]- Remediation
View remediation
