Back to skill

Security audit

Neural Network Ops

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent OpenClaw operations playbook, but one recovery step can delete all main-agent session data without a backup or confirmation step.

Review before installing or using this skill in production. Most guidance is ordinary operations advice, but replace the orphaned-message recovery step with a safer procedure that backs up or quarantines session files first, identifies the affected session, and requires explicit operator confirmation before any deletion.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:70
Finding

Destructive Session Recovery Deletes All Agent Session Data Without Backup or Confirmation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 70-77
Vulnerability Type: Destructive administrative recovery procedure
Risk Level: Medium

Vulnerable Code

bash
systemctl stop openclaw-gateway
rm -rf /root/.openclaw/.openclaw/agents/main/sessions/*
echo '{}' > /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
chmod 600 /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
systemctl start openclaw-gateway

Technical Analysis

The recovery playbook responds to a repeated orphaned user message condition by recursively deleting every entry in the main agent's session directory and replacing the session index with an empty JSON object. The procedure does not:

  • Back up session files before deletion.
  • Request explicit operator confirmation.
  • Identify and remove only the corrupted session.
  • Validate the target path before invoking rm -rf.
  • Provide a rollback or restoration process.

The command is expected to run with sufficient privileges to manage system services and modify files under /root. Although the path is static and does not present a demonstrated command-injection vector, the documented response is substantially broader than necessary for repairing an individual orphaned session. It also conflicts with the skill's own guardrail requiring backups before major edits.

Attack Path

  1. A repeated orphaned user message entry appears in the gateway logs, whether due to ordinary corruption or an externally induced malformed interaction.
  2. An operator or privileged agent follows the recovery playbook.
  3. The gateway is stopped, interrupting service.
  4. rm -rf removes all files and directories beneath the main agent's session directory, not merely the affected session.
  5. The session index is overwritten with an empty object.
  6. The gateway restarts without the deleted session state.
  7. In the absence of a separate backup, the prior state ...[truncated 720 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require explicit operator confirmation before deleting or resetting session state.
  2. Stop the gateway and create a timestamped backup with restrictive permissions before making changes:
    bash
    session_dir=/root/.openclaw/.openclaw/agents/main/sessions
    backup_dir="/root/.openclaw/backups/sessions-$(date +%Y%m%dT%H%M%S)"
    install -d -m 700 "$backup_dir"
    cp -a -- "$session_dir/." "$backup_dir/"
    
  3. Diagnose the affected session identifier from validated logs and quarantine only that session rather than deleting the entire directory.
  4. Canonicalize and verify the target directory before any destructive operation. Refuse to proceed if it is empty, missing, a symbolic link, or differs from the expected path.
  5. Prefer reversible quarantine using mv over permanent deletion.
  6. Validate the reconstructed session index before restarting the gateway, preserving unaffected entries where possible.
  7. Document and test a rollback process that restores the backup and its ownership and permissions.
  8. If a full reset is genuinely necessary, present it as a last-resort operation with a clear data-loss warning rather than the default response to the log pattern.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This finding correctly identifies a dangerous parameter pattern: privileged rm -rf with a wildcard against application state. In an operational skill intended for troubleshooting, such instructions are especially risky because they may be executed under pressure, turning a recoverable messaging issue into permanent state loss.

Content

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

bash
systemctl stop openclaw-gateway
rm -rf /root/.openclaw/.openclaw/agents/main/sessions/*
echo '{}' > /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
chmod 600 /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
systemctl start openclaw-gateway

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

This finding correctly identifies a dangerous parameter pattern: privileged rm -rf with a wildcard against application state. In an operational skill intended for troubleshooting, such instructions are especially risky because they may be executed under pressure, turning a recoverable messaging issue into permanent state loss.

Content

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

bash
systemctl stop openclaw-gateway
rm -rf /root/.openclaw/.openclaw/agents/main/sessions/*
echo '{}' > /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
chmod 600 /root/.openclaw/.openclaw/agents/main/sessions/sessions.json
systemctl start openclaw-gateway

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes destructive recovery steps that delete all session data and recreate the session index without any explicit warning, confirmation gate, or backup step. In an agent skill, operators may follow these instructions mechanically during incident response, causing irreversible loss of conversation state and potentially masking underlying issues.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

systemctl stop openclaw-gateway rm -rf /root/.openclaw/.openclaw/agents/main/sessions/* echo '{}' > /root/.openclaw/.openclaw/agents/main/sessions/sessions.json chmod 600 /root/.openclaw/.openclaw/agents/main/sessions/sessions.json systemctl start openclaw-gateway

text

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

bash
systemctl restart ollama
curl -s -X POST http://127.0.0.1:11434/api/chat \
  -H 'Content-Type: application/json' \
  -d '{"model":"qwen2.5:7b","messages":[{"role":"user","content":"hi"}],"stream":false}'

Static analysis

Detected: suspicious.destructive_delete_command

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
SKILL.md:77