T09 · Insecure Skill Coding Practices
- Location
SKILL.md:39- Finding
Plaintext Persistence of Potentially Sensitive Task Context
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:39-45,SKILL.md:77-101, andSKILL.md:107-112
Vulnerability Type: Plaintext sensitive-data storage without access-control requirements
Risk Level: MediumVulnerable Code Snippet
The following is an English translation of the relevant source instructions:
markdown Parse the task state file and extract: - Task description: the user's original request - Current progress: completed steps - Incomplete items: remaining steps - Key context: file paths, configuration values, intermediate results, etc. - Interruption reason: if it can be determinedjson { "version": 1, "taskId": "uuid-here", "createdAt": "2026-04-02T10:30:00+08:00", "updatedAt": "2026-04-02T11:15:00+08:00", "description": "The user's original task description", "status": "in_progress", "steps": [ {"name": "Step 1", "status": "done", "result": "Brief result"}, {"name": "Step 2", "status": "done", "result": "Brief result"}, {"name": "Step 3", "status": "pending"}, {"name": "Step 4", "status": "pending"} ], "context": { "key1": "value1", "key2": "value2" }, "lastCheckpoint": "After completion of Step 2" }markdown When executing a multi-step task, update the state file after each key step: 1. Create `.task-state.json` when the task starts. 2. After each step, update the corresponding status and result. 3. Delete the state file after the entire task is complete.Technical Analysis
The Skill directs the agent to persist the user's original request, file paths, configuration values, intermediate results, and step results in the human-readable file
~/.openclaw/workspace-main/.task-state.json.These fields can contain credentials, API tokens, private repository paths, deployment details, customer information, command output, or other sensitive operational data. The instructions ...[truncated 1742 chars]
- Remediation
View remediation
Remediation Suggestions
- Explicitly prohibit storing passwords, API tokens, session cookies, private keys, environment-variable values, and raw sensitive output.
- Define a strict allowlisted schema containing only the minimum information required to resume a task.
- Apply secret detection and redaction before writing descriptions, context, or results.
- Create the state file with owner-only permissions, such as mode
0600, and verify that its parent directory is not writable by untrusted users. - Use atomic writes through a securely created temporary file followed by a rename.
- Reject symbolic links and verify file ownership before reading, writing, or deleting the state file.
- Add expiration timestamps and delete stale, abandoned, invalid, or completed state automatically.
- Where sensitive state is unavoidable, encrypt it using a key stored separately from the workspace.
- Document that state content must be treated as sensitive and must not be committed to source control or included in routine logs and backups.
