Back to skill

Security audit

OpenClaw Security Hardening Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent security-hardening skill, but it includes under-scoped credential inspection, broad process termination, and persistent scheduling guidance that users should review before installing.

Install only if you are comfortable with an agent handling OpenClaw security operations. Before running commands, replace token checks with redacted checks, approve any credential scans explicitly, review process-kill matches before terminating them, avoid the plaintext ifconfig.me probe, and do not let an agent invent a cron-based credential rotation task without a reviewed script and rollback plan.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:45
Finding

Sensitive Configuration and Credential Reconnaissance May Expose Secrets to Agent Context

Content
View full analysis
/dev/null find ~/.openclaw/workspace -name "*.json" | xargs grep -l "sk_live\|rk_live\|ghp_\|re_" 2>/dev/null ``` ```bash find ~/.openclaw/workspace -name "*.json" -o -name "*.env" | \ xargs grep -l "sk_\|rk_\|ghp_\|re_\|Bearer" 2>/dev/null ``` ### Technical Analysis The Skill instructs the agent to inspect OpenClaw configuration and systematically enumerate files likely to contain credentials. Credential discovery is relevant to the declared security-audit functionality, but the implementation does not consistently enforce least privilege or redact sensitive output. In particular, the gateway-token command prints matching configuration lines rather than reporting only whether a token exists, whether it is empty, or whether its length is adequate. Depending on the configuration format, the actual gateway token may consequently be placed in terminal output, agent context, execution transcripts, or retained logs. The broader file scans return the locations of likely secret-bearing files. Although the `grep -l` operations do not print the matched secret values, they create a useful credential inventory that becomes available to any later compromised agent instruction or untrusted content in the same session. The `find` expressions also lack grouping around their `-o` conditions. While this does not directly expose additional file contents in the shown commands, explicit grouping would make the intended scope clearer and less error-prone. ### Attack Path 1. A user loads the Skill and authorizes the credential-protection audit. 2. The agent executes the gateway-token grep command ...[truncated 1476 chars]
Remediation
View remediation
/dev/null ``` 7. Prevent command output containing secrets from being copied into persistent memory or ordinary application logs. 8. Prefer a dedicated secret scanner that redacts matches and supports allowlists. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:38
Finding

Unvalidated Third-Party Public-IP Lookup Is Used in a Plaintext Network Probe

Content
View full analysis
Remediation
View remediation
&2 exit 1 fi ``` 5. Quote all variable expansions. 6. Prefer a user-supplied, trusted external probe endpoint. 7. Clearly state that a same-host public-IP request is not definitive evidence of internet reachability. 8. Avoid sending tokens, headers, configuration data, or other secrets during the probe. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:295
Finding

Broad Process-Name Matching Can Terminate Unrelated Applications

Content
View full analysis
Remediation
View remediation

T06 · System Persistence

Note
Location
SKILL.md:348
Finding

Credential-Rotation Guidance Recommends Underspecified Cron Persistence

Content
View full analysis
Remediation
View remediation
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (15)

YARA rule 'c2_framework_indicators': Command-and-control framework indicators (Cobalt Strike, Metasploit, Sliver, etc.) [malware]

Critical
Category
YARA Match
Confidence
85% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

PURPOSE

This skill closes the five most exploited attack surfaces in live OpenClaw deployments: instance exposure, credential leakage, malicious skill installation, unauthorized gateway access, and post-compromise recovery.

Every section maps to a real threat vector. CVE-2026-25253 demonstrated that unprotected OpenClaw instances with public gateway endpoints are trivially exploitable. ClawHavoc demonstrated that skill installation is a reliable code execution path when no verification protocol exists. This toolkit addresses both.


SECTION 1: INSTANCE EXPOSURE AUDIT

Run this checklist before assuming your instance is protected.

1.1 — Network Exposure Check

bash
# Check what ports OpenClaw gateway is binding on
ss -tlnp | grep -E '18789|18790|18800'

# Expected (safe): 127.0.0.1:18789 — gateway bound to loopback only
# Dangerous: 0.0.0.0:18789 — gateway exposed to all interfaces

# Check for external reachability (run from a different machine or use curl t

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## SECTION 2: CREDENTIAL PROTECTION

### 2.1 — .env File Isolation Rules

Never store credentials in:
- The workspace root (`~/.openclaw/workspace/*.env`)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

bash
# Audit current credential exposure
find ~/.openclaw/workspace -name "*.env" -o -name ".env*" 2>/dev/null
find ~/.openclaw/workspace -name "*.json" | xargs grep -l "sk_live\|rk_live\|ghp_\|re_" 2>/dev/null

# If any hits: move credentials to /etc/default/aegis immediately

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

bash
# Audit current credential exposure
find ~/.openclaw/workspace -name "*.env" -o -name ".env*" 2>/dev/null
find ~/.openclaw/workspace -name "*.json" | xargs grep -l "sk_live\|rk_live\|ghp_\|re_" 2>/dev/null

# If any hits: move credentials to /etc/default/aegis immediately

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 · SKILL.md (reported line 19)May include surrounding context.

md
Every section maps to a real threat vector. CVE-2026-25253 demonstrated
that unprotected OpenClaw instances with public gateway endpoints are
trivially exploitable. ClawHavoc demonstrated that skill installation
is a reliable code execution path when no verification protocol exists.
This toolkit addresses both.

---

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

bash
# Audit current credential exposure
find ~/.openclaw/workspace -name "*.env" -o -name ".env*" 2>/dev/null
find ~/.openclaw/workspace -name "*.json" | xargs grep -l "sk_live\|rk_live\|ghp_\|re_" 2>/dev/null

# If any hits: move credentials to /etc/default/aegis immediately

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

FERNET_KEY=<generated_value>

NEVER store in:

- openclaw.json (world-readable to agents)

- workspace files

- git repositories

text

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

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

FERNET_KEY=<generated_value>

NEVER store in:

- openclaw.json (world-readable to agents)

- workspace files

- git repositories

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% 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 180)May include surrounding context.

md
grep -iE "curl.*\$[A-Z_]+|wget.*\$[A-Z_]+" /path/to/SKILL.md
grep -iE "base64|eval\s*\$|exec.*env\s" /path/to/SKILL.md
grep -iE "SOUL\.md|AGENTS\.md|openclaw\.json" /path/to/SKILL.md
grep -iE "cron|at\s+[0-9]|systemctl enable" /path/to/SKILL.md
grep -iE "private_keys|system_configs|auth_files" /path/to/SKILL.md

# Any hit = manual review required before activation

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 270)May include surrounding context.

bash
# Lock down the workspace directory ownership
chmod 750 ~/.openclaw/workspace
chmod 600 ~/.openclaw/workspace/*.md

# Prevent world-readable credential files

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 271)May include surrounding context.

bash
# Lock down the workspace directory ownership
chmod 750 ~/.openclaw/workspace
chmod 600 ~/.openclaw/workspace/*.md

# Prevent world-readable credential files
chmod 600 /etc/default/aegis

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 274)May include surrounding context.

md
chmod 600 ~/.openclaw/workspace/*.md

# Prevent world-readable credential files
chmod 600 /etc/default/aegis
chown root:root /etc/default/aegis  # or your agent user

# Verify no sensitive files are in git-tracked locations

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 333)May include surrounding context.

md
[ ] AGENTS.md audited for unauthorized changes
[ ] HEARTBEAT.md audited
[ ] Installed skills directory audited for unauthorized files
[ ] Cron jobs audited: crontab -l and systemctl list-units --type=timer
[ ] New gateway token set (minimum 32 hex chars)
[ ] Gateway restarted with new config
[ ] Incident logged in memory/YYYY-MM-DD.md with timeline

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% 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 368)May include surrounding context.

md
[ ] AGENTS.md audited for unauthorized changes
[ ] HEARTBEAT.md audited
[ ] Installed skills directory audited for unauthorized files
[ ] Cron jobs audited: crontab -l and systemctl list-units --type=timer
[ ] New gateway token set (minimum 32 hex chars)
[ ] Gateway restarted with new config
[ ] Incident logged in memory/YYYY-MM-DD.md with timeline

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

md
ss -tlnp | grep -E '18789|18790|18800'

# Audit credentials in workspace
find ~/.openclaw/workspace -name "*.json" -o -name "*.env" | \
  xargs grep -l "sk_\|rk_\|ghp_\|re_\|Bearer" 2>/dev/null

# Check for unauthorized cron jobs

Static analysis

No suspicious patterns detected.