Back to skill

Security audit

Clawreverse

Security checks for vulnerabilities and agentic risk

Overview

This session-recovery plugin is mostly purpose-aligned, but some commands can overwrite workspace files and persist or launch branched agent state without strong built-in safeguards.

Install only if you are comfortable with a recovery plugin that can modify OpenClaw configuration, store session transcripts and prompts, clone checkpointed workspace contents, create child agents/sessions, and in some workflows overwrite live workspace files. Prefer read-only listing commands first, avoid checkout or --restore-workspace unless you have a backup and have confirmed the target agent/session/checkpoint, and use --clone-auth never when available if you do not want auth-like settings copied.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

other

Warning
Location
openclaw.plugin.json:7
Finding

Declared Plugin Runtime Is Missing from the Distributed Package

Content
View full analysis

Vulnerability Details

File Location: openclaw.plugin.json:7-9
Corroborating Locations: package.json:7-11, package.json:13-16, SKILL.md:48-60
Vulnerability Type: Incomplete or misleading plugin package
Risk Level: Medium

Vulnerable Code

openclaw.plugin.json:7-9:

json
"runtime": {
  "entry": "./dist/index.js"
},

package.json:7-11:

json
"type": "module",
"main": "./dist/index.js",
"exports": "./dist/index.js",
"scripts": {
  "test": "node --test"
},

package.json:13-16:

json
"openclaw": {
  "extensions": [
    "./dist/index.js"
  ]
},

SKILL.md:48-60:

markdown
## First step: verify or install the plugin

1. Check whether the plugin is already available:

```bash
openclaw reverse --help
  1. If the command is missing, install the plugin from this skill bundle:
bash
openclaw plugins install -l "{baseDir}"
text

### Technical Analysis

Both plugin manifests declare `./dist/index.js` as the executable runtime entry point. However, the audited package inventory contains only:

- `SKILL.md`
- `openclaw.plugin.json`
- `package.json`

The declared `dist/index.js` file and the entire `dist` directory are absent. The documentation nevertheless instructs users to install the local package and states that the plugin files are available in the skill bundle.

Because the executable implementation is missing, none of the advertised checkpoint, rollback, workspace-restoration, session-inspection, or branching behavior can be verified or executed from the supplied artifact. This is primarily a package-integrity and availability defect rather than evidence of malicious runtime behavior.

The absent runtime also prevents review of security-sensitive operations described by the documentation, including filesystem restoration, configuration modification, session rollback, child-agent creation, and authentication cloning. Their safety cannot be established from the distributed files.

### Attack Path

1
...[truncated 1271 chars]
Remediation
View remediation

Remediation Suggestions

  1. Include the complete dist/index.js runtime and every transitive local file required by it in the distributed package.
  2. Add a release-time validation step that fails packaging when any path declared by runtime.entry, main, exports, or openclaw.extensions is missing.
  3. Test installation and command execution from the exact final release artifact rather than from a development checkout.
  4. Publish the corresponding reviewable source code and reproducible build instructions for the generated runtime.
  5. Cryptographically sign or checksum release artifacts so users can verify that the reviewed source corresponds to the distributed package.
  6. Add an installation-time integrity check before modifying OpenClaw configuration or registering the plugin.
  7. Remove or clearly qualify installation and setup instructions until the runtime is present and its behavior has undergone security review.
  8. Add automated smoke tests covering plugin loading, openclaw reverse --help, setup, rollback safeguards, workspace path validation, and authentication-cloning behavior.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The skill description frames the capability as session recovery, but the documented behavior includes plugin installation, config patching, checkpoint restoration, and optional live workspace restoration. That mismatch can mislead operators about the real mutation scope, increasing the chance of unexpected filesystem or state changes during use.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description frames the capability as session recovery, but the documented behavior includes plugin installation, config patching, checkpoint restoration, and optional live workspace restoration. That mismatch can mislead operators about the real mutation scope, increasing the chance of unexpected filesystem or state changes during use.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

Workspace restore can delete or overwrite the configured target path as part of rollback, which is inherently destructive and can cause irreversible data loss if invoked on the wrong checkpoint, wrong path, or stale state. In this skill's context, restore is the primary feature, so the danger is heightened because users are likely to invoke it during failure recovery when mistakes are more probable.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The git-based restore path unconditionally removes the target directory and repopulates it from an archived commit, which can destroy uncheckpointed local files and any concurrent changes made after the checkpoint. Because this plugin is specifically designed to roll back OpenClaw workspaces, the destructive behavior is expected functionally but still security-relevant due to integrity and availability loss from accidental or unauthorized invocation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises installation and use of a local OpenClaw plugin and references environment-dependent execution (openclaw, {baseDir}, filesystem paths), but it declares no explicit tool scope or permissions. That omission weakens least-privilege controls and can cause an agent to invoke shell/env-capable operations without clear authorization boundaries.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The skill is explicitly designed to persist, restore, branch, and inspect prior OpenClaw sessions and associated workspace state. Session persistence is intentional here, but it still carries security risk because checkpoints, rollback reports, cloned workspaces, and branch records may retain sensitive prompts, outputs, credentials, or file contents beyond their original lifetime.

Content

Scanner excerpt · SKILL.md (reported line 3)May include surrounding context.

md
---
name: clawreverse
description: Inspect, checkpoint, rollback, and branch OpenClaw sessions with the ClawReverse plugin. Use when a user wants to recover from bad tool or file changes, restore a known-good checkpoint, inspect session lineage, create a child branch from an earlier point, or avoid re-spending tokens after a long OpenClaw run. Do not use for plain git history operations or non-OpenClaw workspaces.
version: 0.1.0
homepage: https://github.com/OpenKILab/ClawReverse
metadata: {"openclaw":{"emoji":"⏪","homepage":"https://github.com/OpenKILab/ClawReverse","requires":{"bins":["openclaw"]}}}

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The removePath function performs a recursive, forceful deletion via fs.rm, which is a safety-critical operation. In this file there is no confirmation prompt, logging, print statement, or explanatory comment/docstring warning that the helper irreversibly deletes the supplied path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

replacePathWithCopy first calls removePath on the destination and then force-copies new content into place, making it a potentially destructive replacement operation. There is no local confirmation, logging, or explanatory comment/docstring warning about this behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code accesses sensitive credentials from process environment variables and later uses them in CLI invocation paths. While the file contains internal error/log handling, there is no user-facing warning, confirmation, or explanatory comment/docstring here disclosing that gateway tokens/passwords may be consumed and transmitted for authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This function spawns detached child processes and redirects output to a log file, which is a safety-relevant action because it starts ongoing background execution on the user's system. The implementation includes internal logging only under some conditions, but no general user-facing disclosure here that commands may continue running after the CLI returns.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The setup flow creates directories and writes openclaw.json when not in dry-run mode, which changes local user configuration and filesystem state. Although the command description says it initializes config, this file provides no explicit warning, confirmation, or prominent disclosure that files and directories will be created or modified.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The continuation path does more than restore state: it actively starts a new run via CLI, subagent runtime APIs, gateway RPC, or helper methods. Because the prompt and session context are reused to launch execution, this can trigger unintended agent actions, external tool use, or token spend under the guise of a recovery operation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code creates a new agent entry, writes it into the OpenClaw config, syncs the in-memory API config, and provisions corresponding agent storage. That exceeds passive checkpoint inspection/rollback and permanently alters the runtime configuration surface, which can persist beyond the immediate recovery action and broaden what the skill can affect if invoked unexpectedly or with attacker-influenced parameters.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The fork path performs high-impact side effects: copying agent directories, materializing workspace snapshots, creating session files, deleting paths on error, and rewriting configuration, yet this code path shows no built-in user-facing consent or disclosure checkpoint. In a plugin that can be triggered through higher-level agent workflows, hidden filesystem and config mutations increase the risk of unexpected persistence, data duplication, and destructive cleanup.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This helper creates directories and writes the session index JSON file, which modifies persisted session metadata and could overwrite existing state. In this file there is no confirmation prompt, no user-facing print/log, and no explanatory comment or docstring warning users that session metadata is being written.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This function creates directories and overwrites the session transcript file via fs.writeFile, which is a safety-relevant file write affecting persisted user/session data. The code includes no confirmation prompt, no user-facing log/print, and no explanatory comment/docstring disclosing that transcript contents will be written to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The rollback method invokes executeRollback with a restoreWorkspace option, which indicates a potentially destructive workspace-changing action. Although the method writes an internal log entry, there is no user-facing confirmation prompt, warning comment/docstring, or other disclosure in this file about the impact of restoring prior state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The continue operation logs the raw prompt string directly into structured logs, which can expose sensitive user content, secrets, credentials, or proprietary data to log sinks and operators. In a session recovery/branching plugin, prompts may contain highly sensitive context from prior runs, making indiscriminate logging a meaningful confidentiality risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Checkpoint creation persists a transcript prefix from an arbitrary transcript path into the snapshot directory, which can capture prior conversation content and potentially sensitive data without any consent, minimization, or disclosure at this layer. In a recovery/checkpointing skill, that increases privacy and data-retention risk because restoring and branching workflows may cause users to assume only workspace state is being saved.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The remove and pruneSession methods delete checkpoint files via removePath, but this file provides no confirmation prompt, logging, or explanatory comment/docstring warning that stored checkpoint data may be permanently removed. For a code file, destructive file deletions without any visible disclosure meet the missing-user-warning criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The writeJsonFile function creates directories and writes JSON content to disk, which can modify user or system data. In this file, the operation has no confirmation prompt, logging, print statement, or explanatory comment/docstring disclosing that persistence side effect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This function reads existing JSON, applies an updater, and writes the resulting value back to the provided path. The persistence behavior is safety-relevant because it alters stored data, but the file provides no inline warning, comment, or user-facing disclosure for that action.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The writeJson function creates parent directories and writes data to the target file, which can overwrite existing contents. This file provides no confirmation, logging, or explanatory comment/docstring to disclose that behavior to users or maintainers.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest emphasizes inspecting sessions and restoring or branching from checkpoints, but does not mention runtime control over active executions. stopRun issues stop operations through helpers or by sending /stop to the agent gateway, adding a run-control capability beyond the declared purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The code reads environment variables such as OPENCLAW_STATE_DIR, OPENCLAW_HOME, and OPENCLAW_CONFIG_PATH to determine state and config locations, but there is no nearby comment, docstring, or user-facing log disclosing that environment-derived configuration is being used. For code files, accessing environment-based configuration can warrant a warning when no disclosure is present in the file.

Content

No source excerpt is available for this finding.