Back to skill

Security audit

Kinema's Task Management (daily report, active push, traceback)

Security checks for vulnerabilities and agentic risk

Overview

This task-management skill is mostly coherent, but it needs review because its helper scripts can write outside the intended task folders and its setup can create persistent scheduled reports to external chats.

Install only if you are comfortable with local task persistence and, in OpenClaw mode, scheduled reports being sent to a confirmed chat destination. Before enabling automation, restrict or fix the helper scripts to validate task IDs and dates, and make sure you know how to disable the cron jobs and delete stored task files.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create-task.sh:20
Finding
Unvalidated task identifiers allow path traversal outside the task directories<![CDATA[ ## Vulnerability Details **File Location**: `scripts/create-task.sh:20-45`; `scripts/archive-task.sh:16-54` **Vulnerability Type**: Path traversal and unrestricted filesystem access **Risk Level**: High ### Vulnerable Code From `scripts/create-task.sh`: ```bash TASK_ID="$1" TITLE="$2" PRIORITY="$3" DOMAIN="$4" DUE_DATE="${5:-—}" DESCRIPTION="${6:-}" TODAY=$(date +%Y-%m-%d) if [ -z "$TASK_ID" ] || [ -z "$TITLE" ] || [ -z "$PRIORITY" ] || [ -z "$DOMAIN" ]; then echo "Usage: create-task.sh <task_id> <title> <priority> <domain> [due_date] [description]" >&2 exit 1 fi # Ensure active directory exists mkdir -p "$ACTIVE_DIR" FILE="$ACTIVE_DIR/${TASK_ID}.md" if [ -f "$FILE" ]; then echo "Error: $FILE already exists" >&2 exit 1 fi cat > "$FILE" << EOF # ${TASK_ID}: ${TITLE} ``` From `scripts/archive-task.sh`: ```bash TASK_ID="$1" NEW_STATUS="$2" REASON="${3:-状态变更: $NEW_STATUS → 移入 archived}" TODAY=$(date +%Y-%m-%d) if [ -z "$TASK_ID" ] || [ -z "$NEW_STATUS" ]; then echo "Usage: archive-task.sh <task_id> <new_status> [reason]" >&2 echo " new_status: Done | Cancelled" >&2 exit 1 fi if [[ "$NEW_STATUS" != "Done" && "$NEW_STATUS" != "Cancelled" ]]; then echo "Error: new_status must be Done or Cancelled" >&2 exit 1 fi SRC="$ACTIVE_DIR/${TASK_ID}.md" if [ ! -f "$SRC" ]; then echo "Error: $SRC not found" >&2 exit 1 fi # Ensure archive directory exists mkdir -p "$ARCHIVE_DIR" # Update status in Metadata sed -i "s/^| 状态 | .* |$/| 状态 | ${NEW_STATUS} |/" "$SRC" # Update 最后更新 sed -i "s/^| 最后更新 | .* |$/| 最后更新 | ${TODAY} |/" "$SRC" # Append changelog entry (before the last line or at end) echo "| ${TODAY} | ${REASON} |" >> "$SRC" # Move to archived DST="$ARCHIVE_DIR/${TASK_ID}.md" mv "$SRC" "$DST" ``` ### Technical Analysis Both scripts document the task identifier as having the form `TASK-XXXXX`, but they only check whether the argument is nonempty. The value is directly interpolated into filesystem paths. A task identifier cont ...[truncated 2317 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce the documented task identifier format before constructing any path: ```bash if [[ ! "$TASK_ID" =~ ^TASK-[0-9]{5}$ ]]; then echo "Error: task_id must match TASK-XXXXX" >&2 exit 1 fi ``` 2. Canonicalize both the base directory and candidate path, then verify that the candidate remains below the expected directory: ```bash base=$(realpath -m -- "$ACTIVE_DIR") candidate=$(realpath -m -- "$ACTIVE_DIR/${TASK_ID}.md") case "$candidate" in "$base"/*) ;; *) echo "Error: resolved path escapes active directory" >&2 exit 1 ;; esac ``` 3. Apply an equivalent boundary check to both source and destination paths in `archive-task.sh`. 4. Reject symbolic-link destinations and sources where appropriate. For new files, use exclusive creation rather than a separate `-f` check followed by redirection. 5. Add `set -euo pipefail` so failed edits or moves stop execution immediately. 6. Make archive operations transactional where possible: write the updated content to a securely created temporary file inside the destination filesystem, verify it, and atomically rename it. 7. Add regression tests covering identifiers with `../`, absolute paths, path separators, malformed numeric portions, oversized values, and symbolic links. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/snapshot.sh:14
Finding
Unvalidated snapshot date allows arbitrary Markdown file overwrite through path traversal<![CDATA[ ## Vulnerability Details **File Location**: `scripts/snapshot.sh:14-18,58-77` **Vulnerability Type**: Path traversal and arbitrary file overwrite **Risk Level**: High ### Vulnerable Code ```bash # Default to Beijing time (UTC+8) DATE="${2:-$(TZ=Asia/Shanghai date +%Y-%m-%d)}" mkdir -p "$SNAP_DIR" SNAP_FILE="$SNAP_DIR/${DATE}.md" ``` ```bash # Write snapshot cat > "$SNAP_FILE" << EOF # Snapshot — ${DATE} > 生成时间:${DATE} 09:00 BJT ## 任务列表 | 任务 | 标题 | 状态 | 优先级 | 领域 | 截止日期 | |------|------|------|--------|------|---------| $(echo -e "$tasks") ## 摘要 ${summary} EOF echo "Snapshot written: $SNAP_FILE" echo "$summary" ``` ### Technical Analysis The second positional argument is documented as a date in `YYYY-MM-DD` format, but the script does not validate either its syntax or its semantic validity. It is directly inserted into the destination filename. A value containing `../` path components can escape the `snapshots/` directory. The `cat > "$SNAP_FILE"` redirection creates the resolved file if it does not exist and truncates it if it already exists. Unlike the task-creation script, there is no existence check at all. Shell quoting does not mitigate this issue because path traversal is performed by filesystem path resolution, not by shell tokenization. The redirection may also follow a symbolic link at the destination. ### Attack Path 1. An attacker or untrusted invocation controls the optional date argument passed to `snapshot.sh`. 2. The attacker supplies a traversal value such as `../../other-file`. 3. The script constructs a path equivalent to `snapshots/../../other-file.md`. 4. The operating system resolves the destination outside `snapshots/`. 5. Shell redirection truncates or creates the escaped Markdown file. 6. Snapshot content is written with the privileges of the Agent process. ### Impact Assessment The vulnerability permits overwriting any writable Markdown file reachable through the crafted relative path. Existing content is trun ...[truncated 340 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce the exact date syntax: ```bash if [[ ! "$DATE" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then echo "Error: date must use YYYY-MM-DD format" >&2 exit 1 fi ``` 2. Verify that the date is semantically valid and round-trips to the same value: ```bash normalized=$(TZ=Asia/Shanghai date -d "$DATE" +%Y-%m-%d 2>/dev/null) || { echo "Error: invalid date" >&2 exit 1 } if [ "$normalized" != "$DATE" ]; then echo "Error: invalid or noncanonical date" >&2 exit 1 fi ``` 3. Canonicalize `SNAP_DIR` and `SNAP_FILE`, and reject any resolved destination that is not directly below the snapshot directory. 4. Reject symbolic-link destinations and define an explicit overwrite policy. If snapshots should not be replaceable, use exclusive file creation. 5. Generate the snapshot in a secure temporary file created with `mktemp` inside `SNAP_DIR`, then atomically rename it after successful generation: ```bash tmp=$(mktemp "$SNAP_DIR/.snapshot.XXXXXX") trap 'rm -f -- "$tmp"' EXIT # Write validated content to "$tmp" mv -- "$tmp" "$SNAP_FILE" trap - EXIT ``` 6. Add `set -euo pipefail` and regression tests for traversal strings, absolute paths, malformed dates, invalid calendar dates, existing destinations, and symbolic links. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (31)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description is about task management using markdown files, but the supplied code does not create, update, archive, or inspect tasks at all. Instead, it performs project version auditing by reading SKILL.md, optional plugin JSON manifests, and git tags, then comparing versions. This is a materially different primary purpose and uses unrelated resources (project metadata and git state rather than task files). Therefore, the description does not accurately represent the code's behavior.

Ae1

High
Category
analysis-evasion
Content
**首次使用此 skill 前,必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**首次使用此 skill 前,必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**首次使用此 skill 前,必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
**首次使用此 skill 前,必须先读取 [references/ONBOARDING.md](references/ONBOARDING.md) 完成环境配置。**
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README describes automatic persistence, daily reports, snapshots, and archival, but does not clearly warn users that their task content will be stored and processed automatically. This is risky because users may disclose sensitive personal or work information in conversation without realizing it will be persisted and included in automated outputs, increasing privacy and data-handling exposure.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The documented trigger phrases are broad enough to overlap with ordinary task-related conversation, which increases the chance the skill activates without the user intending to invoke persistent task-management behavior. In this skill, unintended invocation is more dangerous because activation can create, modify, archive, or report on user tasks stored on disk, leading to unexpected state changes and privacy-impacting persistence.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger definition is broad enough to activate on ordinary mentions of 'task', '任务', or task-related discussion, which can cause the agent to enter this skill unexpectedly. In an agentic system that reads and writes workspace files, unintended invocation can lead to inappropriate file inspection, accidental task creation, or confusing workflow hijacking without explicit user intent.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The manual-query examples include vague phrases like '看看任务', '任务列表', and '任务报告', which lack clear boundaries and can overlap with normal conversation about tasks rather than a request to run the skill. Because the skill's manual-query flow scans both active and archived task files and generates a report, false activation can expose task metadata or cause unnecessary processing in contexts where the user did not intend task retrieval.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The document broadens the skill into platform-specific automation, cron orchestration, and message delivery setup beyond the stated purpose of maintaining markdown task files. This scope expansion increases attack surface by giving the agent durable scheduled behavior and external communication paths that persist beyond the initiating session.

Session Persistence

Medium
Category
Rogue Agent
Content
### 安装

```bash
mkdir -p ~/.openclaw/workspace/kinema-tasks/active
mkdir -p ~/.openclaw/workspace/kinema-tasks/archived
mkdir -p ~/.openclaw/workspace/kinema-tasks/snapshots
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Session Persistence

Medium
Category
Rogue Agent
Content
### 安装

```bash
mkdir -p ~/.openclaw/workspace/kinema-tasks/active
mkdir -p ~/.openclaw/workspace/kinema-tasks/archived
mkdir -p ~/.openclaw/workspace/kinema-tasks/snapshots
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The onboarding materially expands the skill from local markdown task management into configuring scheduled outbound messaging to external chat destinations. That creates an unnecessary data egress capability: task contents, summaries, status, deadlines, and snapshots can be automatically transmitted outside the local workspace, increasing the risk of privacy leakage or misuse if the destination is wrong or compromised.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The instructions tell the agent to extract inbound metadata and configure scheduled jobs that read task files and push reports to external chat channels, but they do not provide a clear privacy and data-disclosure warning. Because task files can contain sensitive personal planning data, automatic reporting to external channels risks unintended disclosure, especially if metadata is spoofed, stale, or the user misunderstands what will be sent.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Hard-coding Asia/Shanghai scheduling without offering user choice can cause reports and automation to run at unexpected local times. While not a classic exploit, incorrect timing can lead to confidentiality or operational issues, such as messages appearing when the user does not expect them or task state changes occurring at the wrong time.

Skill Enumeration

Medium
Category
Agent Snooping
Content
--to <TO_ID> \
  --announce \
  --timeout-seconds 120 \
  --message "执行 KinemaTasks 归档检查:读取 ~/.openclaw/workspace/skills/kinema-task-management/SKILL.md 了解规范。扫描 ~/.openclaw/workspace/kinema-tasks/active/ 中所有 TASK-*.md 文件,检查 Metadata 表中'状态'字段。如果状态为 Done 或 Cancelled:1) 更新该文件的'最后更新'为今天日期(YYYY-MM-DD)2) 在 Changelog 追加记录(如 'YYYY-MM-DD 状态变更: Done → 移入 archived')3) 将文件从 active/ 移动到 archived/。完成后输出归档摘要,如无需归档则输出'无待归档任务'。"
```

#### 4.2 每日早报(每天 09:01 北京时间)
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
--to <TO_ID> \
  --announce \
  --timeout-seconds 120 \
  --message "执行 KinemaTasks 归档检查:读取 ~/.openclaw/workspace/skills/kinema-task-management/SKILL.md 了解规范。扫描 ~/.openclaw/workspace/kinema-tasks/active/ 中所有 TASK-*.md 文件,检查 Metadata 表中'状态'字段。如果状态为 Done 或 Cancelled:1) 更新该文件的'最后更新'为今天日期(YYYY-MM-DD)2) 在 Changelog 追加记录(如 'YYYY-MM-DD 状态变更: Done → 移入 archived')3) 将文件从 active/ 移动到 archived/。完成后输出归档摘要,如无需归档则输出'无待归档任务'。"
```

#### 4.2 每日早报(每天 09:01 北京时间)
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
--to <TO_ID> \
  --announce \
  --timeout-seconds 120 \
  --message "执行 KinemaTasks 归档检查:读取 ~/.openclaw/workspace/skills/kinema-task-management/SKILL.md 了解规范。扫描 ~/.openclaw/workspace/kinema-tasks/active/ 中所有 TASK-*.md 文件,检查 Metadata 表中'状态'字段。如果状态为 Done 或 Cancelled:1) 更新该文件的'最后更新'为今天日期(YYYY-MM-DD)2) 在 Changelog 追加记录(如 'YYYY-MM-DD 状态变更: Done → 移入 archived')3) 将文件从 active/ 移动到 archived/。完成后输出归档摘要,如无需归档则输出'无待归档任务'。"
```

#### 4.2 每日早报(每天 09:01 北京时间)
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

File System Enumeration

Medium
Category
Data Exfiltration
Content
```bash
# 检查目录
ls -la ~/.openclaw/workspace/kinema-tasks/

# 检查脚本
~/.openclaw/workspace/skills/kinema-task-management/scripts/next-id.sh
Confidence
60% confidence
Finding
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The script forces the Asia/Shanghai timezone and formats dates using Chinese-style output, and later emits Chinese text labels in the report. This imposes a specific locale/language policy on all users without offering a choice or documenting that the skill is region-specific.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
These output lines present the diff section exclusively in Chinese, and similar Chinese-only labels appear elsewhere in the script. Under the policy, forcing a specific language in natural-language output without user choice is a violation unless the regional constraint is explicitly justified.

Session Persistence

Medium
Category
Rogue Agent
Content
#!/bin/bash
# snapshot.sh - Generate and write daily snapshot
#
# Usage: snapshot.sh [TASK_DIR] [date]
#   TASK_DIR: defaults to ~/.openclaw/workspace/kinema-tasks
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Scope Creep

Low
Category
Excessive Agency
Content
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Scope Creep

Low
Category
Excessive Agency
Content
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
Confidence
70% confidence
Finding
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
Natural-language instructions, usage examples, and installation guidance are written in Chinese, but the document does not state that the skill is Chinese-only, offer an English alternative, or provide a user opt-in for language preference. That can violate language/locale policy where skills should not force a language without user choice unless the constraint is explicitly justified.

Static analysis

No suspicious patterns detected.