Back to skill

Security audit

Session Resume

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent session-recovery tool, but it stores and reuses raw task context in a persistent local file without enough safeguards for sensitive data or stale/forged state.

Review before installing. Use this only in workspaces where local `.task-state.json` files are protected and not synced, committed, or shared. Avoid using it for tasks involving passwords, API keys, private keys, incident details, customer data, or sensitive command output unless the skill is updated to redact secrets, restrict file permissions, validate state provenance, and expire stale checkpoints.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • 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

Warning
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, and SKILL.md:107-112
Vulnerability Type: Plaintext sensitive-data storage without access-control requirements
Risk Level: Medium

Vulnerable 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 determined
json
{
  "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

  1. Explicitly prohibit storing passwords, API tokens, session cookies, private keys, environment-variable values, and raw sensitive output.
  2. Define a strict allowlisted schema containing only the minimum information required to resume a task.
  3. Apply secret detection and redaction before writing descriptions, context, or results.
  4. Create the state file with owner-only permissions, such as mode 0600, and verify that its parent directory is not writable by untrusted users.
  5. Use atomic writes through a securely created temporary file followed by a rename.
  6. Reject symbolic links and verify file ownership before reading, writing, or deleting the state file.
  7. Add expiration timestamps and delete stale, abandoned, invalid, or completed state automatically.
  8. Where sensitive state is unavoidable, encrypt it using a key stored separately from the workspace.
  9. Document that state content must be treated as sensitive and must not be committed to source control or included in routine logs and backups.

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:31
Finding

Unauthenticated Persistent State Can Influence Future Agent Sessions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:31-45, SKILL.md:64-69, and SKILL.md:114-119
Vulnerability Type: Untrusted persistent state consumed as authoritative task memory
Risk Level: Medium

Vulnerable Code Snippet

The following is an English translation of the relevant source instructions:

markdown
On a new session, check:

1. Read `~/.openclaw/workspace-main/.task-state.json`.
2. If the file exists and its contents are valid, an incomplete task exists.
3. If the file does not exist or is empty, there is no task to restore.

Parse the task state file and extract:

- Task description
- Current progress
- Incomplete items
- Key context, including file paths, configuration values, and intermediate results
- Interruption reason, if it can be determined
markdown
- If the user says "continue," resume execution from the checkpoint.
- If the user says "abandon," clean up the state file and begin a new task.
- If the user does not respond, keep the state file unchanged.
markdown
It is recommended to add the following to the startup sequence in `AGENTS.md`:

5. Check whether `.task-state.json` exists. If it does, execute the
   session-resume Skill to restore the task.

Technical Analysis

The state file is treated as authoritative evidence of a previous task, but the design does not define provenance or integrity protections. In particular, it does not require:

  • Cryptographic authentication of state
  • Binding the state to a specific user or originating session
  • Verification of file ownership and permissions
  • A strict schema with size and value constraints
  • Separation of stored data from executable agent instructions
  • Detection or rejection of instruction-like content in text fields
  • Verification that pending actions were previously approved

User confirmation before resumption is a useful mitigation, but the described prompt reports ...[truncated 2082 chars]

Remediation
View remediation

Remediation Suggestions

  1. Authenticate serialized state with a keyed message authentication code using a per-install secret stored outside the workspace.
  2. Bind each record to the originating user, workspace, agent identity, and session or task identifier.
  3. Verify file ownership, permissions, file type, and canonical path before loading the state.
  4. Reject symbolic links, unexpected owners, group-writable files, and state files stored in untrusted directories.
  5. Validate a strict JSON schema with field length limits, enumerated statuses, timestamp validation, and rejection of unknown fields.
  6. Treat all persisted strings as untrusted data, never as system or developer instructions.
  7. Store structured action identifiers and validated parameters rather than free-form instructions for pending steps.
  8. Show the state provenance and exact proposed actions to the user before resumption.
  9. Require separate confirmation for destructive, privileged, external, or otherwise consequential actions.
  10. Expire old state and invalidate state after configuration, user identity, or permission changes.
  11. Record and display integrity failures rather than silently loading altered state.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • 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
Findings (8)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · README.md (reported line 227)May include surrounding context.

md
| 📖 Read, don't guess | Only restore explicitly saved information |
| 🗣️ Report first | Always inform user before resuming |
| 💾 Save often | Update state file after each key step |
| 🧹 Clean on complete | Delete state file when task finishes |
| 🔇 Silent when idle | Zero overhead when no task to restore |

### Works with Other Skills

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README explicitly states that the skill persists the original user request, step details, and intermediate context to a JSON file in the workspace, but it does not warn that these fields may contain secrets, personal data, deployment details, or other sensitive content. Because the file survives disconnects and restarts, local disclosure, accidental backup/sync leakage, or reuse by later sessions could expose confidential information.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Using the generic trigger phrase 'resume' creates a collision risk with ordinary conversation, increasing the chance of unintended activation. In a session-recovery skill, accidental triggering can expose old task details or alter workflow state when the user meant something else.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The automatic detection behavior is described broadly but does not define scope limits or negative conditions. Without boundaries, the agent may check for and act on persisted state in contexts where recovery is not appropriate, leading to stale-context injection or unintended disclosure of prior task information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to persist task context locally but provides no warning or minimization guidance for sensitive data retention. Because task descriptions, context values, and intermediate results may contain secrets or personal data, writing them to a predictable file path increases the risk of local disclosure and over-retention.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The restore/report flow directs the agent to persist and later display the user's original request, completed steps, pending work, and key context. In practice this can include credentials, internal paths, incident details, or other sensitive operational data, so automatic recovery can leak high-value information back into a new session or to the wrong user context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The README opens with Chinese branding and a full Chinese-first description before the English section, which may indicate a default language preference not chosen by the user. If the skill emits Chinese responses by default, that would be a language-policy concern unless users can select or opt into that locale.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

Using the generic trigger phrase 'resume' creates a collision risk with ordinary conversation, increasing the chance of unintended activation. In a session-recovery skill, accidental triggering can expose old task details or alter workflow state when the user meant something else.

Content

No source excerpt is available for this finding.