Back to skill

Security audit

task-manager

Security checks for vulnerabilities and agentic risk

Overview

This task-manager skill is not plainly malicious, but it automatically records every assigned task to a persistent TASKS.md file with broad triggers and little user control.

Install only if you want automatic persistent task logging. Avoid putting secrets, credentials, private plans, or sensitive client details in tasks unless you are comfortable with them being written to TASKS.md. Review or change the hardcoded storage path before use, and treat the statistics script as needing hardening before running it on important 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/update-task-stats.js:62
Finding
Incorrect delimiter validation can corrupt the target task file## Vulnerability Details **File Location**: `scripts/update-task-stats.js`, lines 62–68 **Vulnerability Type**: Improper validation of a section delimiter before an in-place file write **Risk Level**: Medium ### Vulnerable Code ```js const statsStart = content.indexOf('## 任务统计'); const statsEnd = content.indexOf('---', statsStart) + 3; if (statsStart === -1 || statsEnd === -1) { console.error('Could not find stats section in file'); process.exit(1); } const newContent = content.substring(0, statsStart) + newStats + content.substring(statsEnd); ``` The resulting content is subsequently written directly over the source file: ```js try { fs.writeFileSync(filePath, newContent, 'utf8'); console.log('Task statistics updated successfully'); console.log(`Total: ${totalTasks}, Running: ${running}, Completed: ${completed}`); console.log(`Persistent: ${persistent}, One-time: ${oneTime}`); } catch (err) { console.error(`Error writing file: ${err.message}`); process.exit(1); } ``` ### Technical Analysis `String.prototype.indexOf()` returns `-1` when the requested delimiter is absent. The script adds `3` to that result before validating it: ```js const statsEnd = content.indexOf('---', statsStart) + 3; ``` If the delimiter is missing, `statsEnd` becomes `2`, not `-1`. Therefore, the condition `statsEnd === -1` cannot detect this failure. A file containing the expected statistics heading but no subsequent `---` delimiter passes validation. The script then constructs replacement content using offset `2` as the end of the old statistics section. Because it writes the result directly over the original file without a backup, temporary file, or atomic rename, malformed input can cause destructive rearrangement or duplication of file content. The caller controls the target path through `process.argv[2]`. Exploitation therefore requires the ability to supply or influence both the processed path and its content, or to modify the normal task file before the ...[truncated 1438 chars]
Remediation
## Remediation Suggestions Validate the raw delimiter-search result before performing arithmetic: ```js const statsStart = content.indexOf('## 任务统计'); const delimiterStart = statsStart === -1 ? -1 : content.indexOf('---', statsStart); if (statsStart === -1 || delimiterStart === -1) { console.error('Could not find a valid stats section in file'); process.exit(1); } const statsEnd = delimiterStart + '---'.length; const newContent = content.substring(0, statsStart) + newStats + content.substring(statsEnd); ``` Apply the following additional hardening measures: 1. Verify that the heading and delimiter occur in the expected order and represent a complete statistics section. 2. Parse the Markdown structure more strictly instead of relying on unrestricted substring searches. 3. Write the updated content to a temporary file in the same directory and atomically rename it over the original only after all validation and writes succeed. 4. Preserve a backup when processing user-important task records. 5. Restrict accepted targets where appropriate, such as requiring a `.md` file within an approved workspace. 6. Add tests for a missing heading, missing delimiter, delimiter before the heading, empty content, truncated content, multiple statistics sections, and write failures.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The release text says the skill will 'automatically take effect' and record 'any new task' without defining clear activation boundaries. That can cause the assistant to invoke the skill in situations the user did not explicitly intend, leading to over-collection of task details and unintended writes to workspace files.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The description advertises automatic recording to TASKS.md but does not clearly warn users that task content will be written to a workspace file by default. Users may disclose sensitive project details, credentials, or internal plans expecting ephemeral handling, only to have them persisted on disk where other tools or users may access them.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The skill description is broad enough to match many ordinary conversations about tasks, tracking, or status, which can cause the agent to invoke this skill unexpectedly. Because the skill then directs automatic file creation and updates, unintended activation can lead to silent workspace writes and persistence of user content without clear consent.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the agent to automatically create and continuously modify `/Users/quenflysmac/.openclaw/workspace/TASKS.md`, but it does not require explicit user notice or consent before writing to disk. In context, this is more dangerous because the skill is designed for ongoing automatic record-keeping, increasing the chance of persistent, repeated writes and accidental storage of sensitive task details.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The natural-language instructions and release description are presented entirely in Chinese, with no indication that users may choose another language or locale. This can be a language policy violation when a skill imposes a specific language without opt-in or documented regional justification.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
文件中的名称、描述和全部操作说明均固定为中文,没有说明这是特定区域或合规场景所必需,也未向用户提供语言选择。对于通用技能,这种隐含的单一语言约束可能违反语言/locale 需可选择或需明确说明的政策要求。

Static analysis

No suspicious patterns detected.