T09 · Insecure Skill Coding Practices
- Location
SKILL.md:45- Finding
Gateway Token Disclosure Through Unredacted Command Output
- Content
View full analysis
- Remediation
View remediation
= 32) PY ``` ]]>
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent security-hardening guide, but some recommended commands could expose secrets, create unsafe copies of sensitive files, or terminate unrelated processes.
Review and adapt the command snippets before installing or using this skill. Replace the gateway-token grep with a redacted or boolean check, create incident evidence directories with restrictive permissions before copying logs/config, and preview exact process IDs before killing anything. The artifact does not show exfiltration or hidden persistence, but its unsafe operational snippets justify Review.
SKILL.md:45Gateway Token Disclosure Through Unredacted Command Output
SKILL.md:301Incident Artifacts May Create Inadequately Protected Copies of Secrets
SKILL.md:295Broad Process-Matching Commands Can Terminate Unrelated Workloads
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
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.
Run this checklist before assuming your instance is protected.
# 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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## SECTION 2: CREDENTIAL PROTECTION
### 2.1 — .env File Isolation Rules
Never store credentials in:
- The workspace root (`~/.openclaw/workspace/*.env`)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 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
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 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
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.
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.
---
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
# 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
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.
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.
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
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Lock down the workspace directory ownership
chmod 750 ~/.openclaw/workspace
chmod 600 ~/.openclaw/workspace/*.md
# Prevent world-readable credential files
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 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
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
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
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.
[ ] 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
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.
[ ] 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
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
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
No suspicious patterns detected.