Back to skill

Security audit

OpenClaw Ops

Security checks for vulnerabilities and agentic risk

Overview

This operations skill is coherent, but it deserves review because it gives an agent broad repair authority and can copy OpenClaw tokens, sessions, and workspace data into plaintext backups.

Install this only on a trusted rescue agent account that is intended to administer the OpenClaw Gateway. Before using the backup or upgrade procedures, restrict backup permissions, avoid copying token files unless necessary, clean up or encrypt backups, and prefer pinned, verified OpenClaw package versions over registry-selected global updates.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:238
Finding

Sensitive credentials and operational data are copied into an unprotected plaintext backup

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 238–255
Vulnerability Type: Plaintext storage of sensitive data with inherited filesystem permissions
Risk Level: Medium

Vulnerable Code

bash
BACKUP_DIR=~/openclaw-backup-$(date +%Y%m%d-%H%M%S)
mkdir -p "$BACKUP_DIR"

# Core files
cp ~/.openclaw/openclaw.json "$BACKUP_DIR/"
[ -f ~/.openclaw/env ] && cp ~/.openclaw/env "$BACKUP_DIR/" || echo "No env file (tokens may be in systemd drop-in or plist)"
cp -r ~/.openclaw/agents "$BACKUP_DIR/"
cp -r ~/.openclaw/devices "$BACKUP_DIR/"
cp -r ~/.openclaw/workspace "$BACKUP_DIR/"

# Service config
if [ "$(uname -s)" = "Linux" ]; then
    cp ~/.config/systemd/user/openclaw-gateway.service "$BACKUP_DIR/" 2>/dev/null
    cp -r ~/.config/systemd/user/openclaw-gateway.service.d "$BACKUP_DIR/" 2>/dev/null
elif [ "$(uname -s)" = "Darwin" ]; then
    cp ~/Library/LaunchAgents/com.openclaw.gateway.plist "$BACKUP_DIR/" 2>/dev/null
fi

Technical Analysis

The backup procedure copies the OpenClaw environment file, agent state, paired-device information, workspace contents, and service configuration into a new plaintext directory. The Skill itself identifies the environment file as containing tokens, while agent and service files may also contain authentication material or operational secrets.

The directory is created using mkdir -p without first setting a restrictive umask or explicitly assigning permissions. Consequently, its effective permissions depend on the invoking user's environment. A permissive umask may make the directory or copied files accessible to other local users or processes. The procedure also provides no encryption, retention limit, or secure disposal mechanism, increasing the number and lifetime of sensitive-data copies.

Attack Path

  1. An operator or rescue agent follows the documented backup procedure.
  2. The procedure creates a predictably named ` ...[truncated 1138 chars]
Remediation
View remediation

Remediation Suggestions

  • Set a restrictive process mask before creating or copying backup data:
    bash
    umask 077
    
  • Create the destination with explicit owner-only permissions:
    bash
    install -d -m 700 "$BACKUP_DIR"
    
  • Apply mode 600 to sensitive copied files and verify ownership after the copy.
  • Exclude ~/.openclaw/env, authentication profiles, and service environment files by default. Back them up only after explicit user approval.
  • Encrypt backups containing secrets using a vetted tool and a key stored separately from the backup.
  • Avoid predictable long-lived plaintext copies where feasible.
  • Define a retention policy and provide a secure deletion or encrypted-key-destruction procedure.
  • Verify backup permissions after creation, for example:
    bash
    find "$BACKUP_DIR" -type d -exec chmod 700 {} +
    find "$BACKUP_DIR" -type f -exec chmod 600 {} +
    

T08 · Insecure Dependencies

Warning
Location
SKILL.md:197
Finding

Global OpenClaw upgrades rely on an unpinned registry-selected package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 197–217
Vulnerability Type: Unsafe third-party package update and supply-chain exposure
Risk Level: Medium

Vulnerable Code

bash
# Check versions
CURRENT=$(openclaw --version)
LATEST=$(npm view openclaw version)
echo "Current: $CURRENT  Latest: $LATEST"

# Perform update
npm update -g openclaw
openclaw --version

# Rollback
npm install -g openclaw@<previous_version>

Technical Analysis

The documented upgrade procedure queries the current registry version and performs a global npm update without pinning an explicitly reviewed release or requiring provenance and integrity verification. The selected package can therefore change after the Skill itself has been audited.

npm installation and update operations may execute package lifecycle scripts with the privileges of the rescue-agent account. Because that account is expected to have read/write access to ~/.openclaw/, a compromised package release or publisher account could access gateway configuration, tokens, agent data, and workspace content.

The rollback command uses a version placeholder but does not require verification that the selected historical package is trusted. Rollback therefore does not independently address registry or artifact compromise.

Attack Path

  1. An attacker compromises the OpenClaw npm publisher account, package registry path, or a dependency included in a newly published release.
  2. The malicious release becomes the registry-selected version.
  3. An operator follows the Skill's update workflow and runs npm update -g openclaw.
  4. npm downloads and installs the compromised package and may execute its lifecycle scripts.
  5. The malicious package executes with the rescue-agent user's permissions.
  6. It accesses or modifies OpenClaw configuration, tokens, agent data, workspace files, or globally installed tooling.
  7. The compromised global CL ...[truncated 654 chars]
Remediation
View remediation

Remediation Suggestions

  • Require the operator to select and approve an explicit version rather than updating to the registry-selected latest release:
    bash
    OPENCLAW_VERSION="reviewed-version"
    npm install -g "openclaw@$OPENCLAW_VERSION"
    
  • Verify package provenance, publisher identity, release signatures, and registry metadata before installation.
  • Compare the package integrity digest against a value obtained through a trusted release channel.
  • Review release notes and dependency changes before applying an upgrade.
  • Disable lifecycle scripts where compatible:
    bash
    npm install -g "openclaw@$OPENCLAW_VERSION" --ignore-scripts
    
  • Test the selected version in an isolated or staging environment before replacing the operational global installation.
  • Record the exact known-good version and verified integrity value so rollback uses a trusted artifact rather than an unverified registry lookup.
  • Continue taking a protected configuration backup and performing post-upgrade health checks, but do not treat those controls as substitutes for package verification.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Requiring read/write access to ~/.openclaw/ grants the rescue agent the ability to modify configs, agents, and sessions, which materially expands the blast radius if the agent is misused, compromised, or tricked by prompt injection. In this maintenance-skill context some elevated access is operationally necessary, but broad write access to the entire workspace is still risky because it could alter persistent behavior or tamper with sensitive state.

Content

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

md
The rescue agent needs:

- **Shell access** on the same machine as the OpenClaw Gateway
- **Read/write access** to `~/.openclaw/` (config, agents, sessions)
- **Node.js 18+** and npm (for the `openclaw` CLI)
- **Optional:** Tailscale CLI (for reverse proxy troubleshooting)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
- Always backup config before editing
- Always validate JSON after editing
- Never print secrets (env files)
- Never delete workspace files without confirmation
- Always verify after restart

## License

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README_CN.md (reported line 37)May include surrounding context.

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README_CN.md (reported line 37)May include surrounding context.

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw
mkdir -p ~/.openclaw/workspace/skills/openclaw-ops

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw
mkdir -p ~/.openclaw/workspace/skills/openclaw-ops

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README_CN.md (reported line 38)May include surrounding context.

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw
mkdir -p ~/.openclaw/workspace/skills/openclaw-ops

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README_CN.md (reported line 42)May include surrounding context.

bash
# Claude Code
mkdir -p ~/.claude/skills/openclaw-ops
cp SKILL.md ~/.claude/skills/openclaw-ops/SKILL.md

# OpenClaw
mkdir -p ~/.openclaw/workspace/skills/openclaw-ops

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
repository: https://github.com/dinstein/openclaw-ops-skill
requirements:
  - Shell access on the same machine as the OpenClaw Gateway
  - Read/write access to ~/.openclaw/ (config, agents, sessions)
  - Read access to systemd user service config (Linux) or LaunchAgents (macOS)
  - Node.js 18+ and npm (for openclaw CLI)
  - Optional: Tailscale CLI (for reverse proxy troubleshooting)

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The backup procedure creates a persistent copy of the OpenClaw configuration and environment under ~/openclaw-backup-, including sensitive files such as ~/.openclaw/env. This increases the attack surface by duplicating secrets and session-related state into an additional location that may have weaker retention, permissions, or monitoring than the original store.

Content

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

bash
BACKUP_DIR=~/openclaw-backup-$(date +%Y%m%d-%H%M%S)
mkdir -p "$BACKUP_DIR"

# Core files
cp ~/.openclaw/openclaw.json "$BACKUP_DIR/"

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

This step explicitly copies ~/.openclaw/env and related operational data into the backup directory, and the note acknowledges tokens may also reside in service configuration. Even though the skill says not to print secrets, persisting additional plaintext copies of tokens and agent data is risky because compromise of the backup location exposes credentials and potentially session history.

Content

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

md
# Core files
cp ~/.openclaw/openclaw.json "$BACKUP_DIR/"
[ -f ~/.openclaw/env ] && cp ~/.openclaw/env "$BACKUP_DIR/" || echo "No env file (tokens may be in systemd drop-in or plist)"
cp -r ~/.openclaw/agents "$BACKUP_DIR/"
cp -r ~/.openclaw/devices "$BACKUP_DIR/"
cp -r ~/.openclaw/workspace "$BACKUP_DIR/"

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Copying LaunchAgent plists or systemd drop-ins into the backup directory can preserve embedded environment variables, command-line secrets, or service settings that enable later persistence or credential theft if the backup is accessed. Service definitions are especially sensitive because they may reveal startup commands, token locations, and autostart behavior.

Content

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

md
cp ~/.config/systemd/user/openclaw-gateway.service "$BACKUP_DIR/" 2>/dev/null
    cp -r ~/.config/systemd/user/openclaw-gateway.service.d "$BACKUP_DIR/" 2>/dev/null
elif [ "$(uname -s)" = "Darwin" ]; then
    cp ~/Library/LaunchAgents/com.openclaw.gateway.plist "$BACKUP_DIR/" 2>/dev/null
fi

echo "Backup saved to $BACKUP_DIR"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

macOS:

~/Library/LaunchAgents/ └── com.openclaw.gateway.plist

text

Static analysis

No suspicious patterns detected.