T09 · Insecure Skill Coding Practices
- Location
scripts/safe-writer.py:160- Finding
Workspace Escape Through Unvalidated Task and Step Identifiers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly does what it claims, but it writes persistent workspace memory and has under-scoped automatic/file-write behavior that users should review before installing.
Install only if you want a Chinese-language task planner that persistently records task progress in the OpenClaw workspace. Avoid using untrusted task IDs or step names, do not enable the heartbeat template unless you verify the script path, and review stored MEMORY.md, memory, and output files for sensitive content after use.
scripts/safe-writer.py:160Workspace Escape Through Unvalidated Task and Step Identifiers
scripts/safe-writer.py:27Predictable Temporary Files Allow Symlink-Based File Overwrite
The declared purpose is task planning, but the described behavior includes persistent memory writing, recovery scanning, and use of auxiliary scripts that are materially broader than simple planning. This mismatch is dangerous because users may consent to a planner while actually enabling a persistence/logging mechanism that stores task content over time and accesses workspace state in ways not transparently described.
The trigger list contains broad, everyday phrases like creating tasks, planning work, organizing work, and project execution, which can cause accidental invocation during normal conversation. Because this skill performs filesystem writes and script execution steps, overbroad activation materially raises the chance of unintended side effects without clear user intent.
Triggers for analysis, research, information extraction, and document generation are especially risky because they map to common benign requests that do not inherently imply permission to create folders, store checkpoints, or scan unfinished tasks. In this context, accidental activation could silently transform a simple content request into a persistent workspace-modifying workflow.
The skill instructs the agent to use shell commands and write to workspace files, but it declares no explicit tool scope or permission boundary. This increases the risk of unintended file modification or command execution because the agent may invoke capabilities that the user was not clearly informed about or that the platform cannot constrain at skill-load time.
文件标题、描述及全部触发词均以中文为主,实际上将技能调用与使用方式绑定到单一语言,但文档未说明这是可选项,也未提供其他语言触发方式。若组织要求避免未经选择地强制特定语言/区域设置,这种默认中文约束属于自然语言层面的策略风险。
The instructions direct the agent to automatically create directories and immediately write checkpoints, but they do not clearly warn the user that the skill will modify the workspace. This is dangerous because users may invoke what appears to be organizational help without realizing it causes persistent file changes and possibly stores sensitive task content.
This markdown file presents all guidance in Chinese and does not indicate that users may choose another language or that the locale is intentionally constrained. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
The entire guide, including headings, instructions, examples, and command descriptions, is written only in Chinese. For a general task-memory guide, this imposes a specific language/locale without any opt-in, alternative language option, or stated region-specific justification, which matches the language/locale policy violation criteria.
This markdown file is entirely written in Chinese and provides no indication that other languages are supported or that the user can choose their preferred language. Under the policy rule for natural-language violations, forcing a specific language without opt-in is a reportable issue.
The manifest describes a skill that creates timestamped task folders and supports step planning, checkpoint save/restore, interruption recovery, and progress tracking. This file instead implements a 'safe memory write' helper that appends content to daily memory files and updates a small metadata JSON file, which is materially narrower and different from the advertised task-planning behavior.
The natural-language description in the script header is entirely in Chinese and does not provide an alternate language or indicate that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation.
Natural-language strings in the module docstring, comments, CLI description, help text, and runtime messages are all in Chinese, with no indication that the user can select another language. Under the stated policy, forcing a specific language without user opt-in is a locale-policy concern.
The code writes to workspace-level shared paths (workspace/memory, workspace/MEMORY.md, workspace/output) rather than isolating all data to a single task. In a multi-task or multi-user environment, this can enable unintended persistence and cross-context data exposure if later tasks or tools read from the same shared store.
The script persists selected content into a shared long-term MEMORY.md file in addition to task-scoped artifacts. Even though it filters for 'important' content, this creates cross-task durable storage that can retain sensitive prompts, analysis results, or secrets longer than users may expect, increasing privacy and data-retention risk.
The CLI accepts arbitrary content and writes it to disk across daily memory, task metadata, and potentially long-term memory without any explicit user-facing warning or confirmation. Users may provide sensitive information assuming transient processing, causing unintentional storage of secrets, personal data, or proprietary material.
This is a natural-language policy issue because the file hard-codes Chinese for the title, status values, prompts, and argparse help text throughout the script. There is no opt-in, alternate locale, or justification that the tool is intended only for a Chinese-language environment.
The manifest describes a task planner focused on creating timestamped task folders, checkpointing, interruption recovery, and progress tracking. While recovery itself is in scope, this file implements that behavior by spawning external interpreter commands via subprocess, which is a broader execution capability than the planner purpose alone justifies and could execute additional logic contained in the target script.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
try:
# Run scan command
result = subprocess.run(
['py', str(manager_script), 'scan'],
capture_output=True,
text=True,
The script recognizes active tasks only when their status is '进行中' or '已暂停', and it instructs users to use the Chinese phrase '恢复上次任务'. This enforces a specific language/locale in both parsing logic and user-facing guidance without opt-in or an alternative, which matches the language/locale policy violation category.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if active_tasks:
latest_task = active_tasks[0]['task_id']
print(f"\nINFO: Auto-recovering: {latest_task}")
subprocess.run([
'py', str(manager_script), 'load',
'--task-ids', latest_task,
'--max-per-task', '5'
The recovery guide for the smarter-task-planner skill constructs a path to and executes a script from a different skill, workspace-organizer. This creates a trust-boundary violation: users enabling heartbeat for this skill may unintentionally run unrelated code, and if that other skill is absent, replaced, or maliciously modified, arbitrary code could execute under the user's context.
The statement that the system will automatically execute the check on heartbeat is overly broad and does not constrain when, how often, or under what safety conditions code runs. In this context, the file already instructs execution of a local Python script, so vague automatic triggering increases the chance of repeated, implicit execution without clear user awareness or administrative control.
The comment at L113 states the basic functionality is 'only saving to daily memory files'. However, the script also calls Update-TaskMetadata, which writes .task-meta.json under the task output directory, so the documentation contradicts the actual side effects.
The header text says "Workspace Organizer quick commands (English)", which imposes a specific language in natural-language documentation without any visible opt-in or alternative locale support. Under the policy, language constraints should either be optional or clearly justified as region-specific.
No suspicious patterns detected.