T09 · Insecure Skill Coding Practices
- Location
references/diagnostics.md:10- Finding
Unscoped Process Termination During Automated Recovery
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent OpenClaw repair runbook, but it can autonomously perform disruptive and access-control actions without enough validation.
Review before installing. This skill is not clearly malicious, but it should only be used where an agent is allowed to restart OpenClaw, inspect local OpenClaw config/session files, and make operator-level decisions. Pairing approvals and broad kill commands should require explicit human confirmation and request validation.
references/diagnostics.md:10Unscoped Process Termination During Automated Recovery
references/diagnostics.md:85Pairing Approval Can Grant Elevated Operator Access Without Request Validation
references/diagnostics.md:30Diagnostic Commands Can Expose Full Configuration and Session Data to Agent Context
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
**Discord-specific:**
1. Check token: `openclaw status` shows token truncation — verify it's not blank
2. Check Discord status: `curl -s https://discordstatus.com/api/v2/status.json | python3 -m json.tool | grep status`
3. Restart gateway: `openclaw gateway restart` (reconnects all channels)
4. If "Invalid Token": token expired — escalate to Jake (needs new bot token)
The skill explicitly instructs the agent to diagnose and remediate failures autonomously and to 'fix first, report after,' which reduces human oversight during operational changes. In an infrastructure-repair context, this can lead to unauthorized or unsafe actions such as restarts, cache clearing, service stoppage, or repeated recovery attempts that worsen outages or destroy forensic context.
---
name: openclaw-self-heal
description: Diagnose and self-resolve OpenClaw system breakage autonomously. Use when: the Control UI / webchat is broken or unreachable, a channel (Discord, Telegram) goes offline or stops responding, the gateway crashes or won't start, memory/plugins report errors, pairing fails, or any OpenClaw component appears broken. Also use proactively during heartbeats when `openclaw status` shows errors. Resolves issues without asking Jake unless the fix requires destructive action or manual intervention.
---
# openclaw-self-heal
The guidance recommends pkill -f openclaw to resolve startup issues, which can terminate all matching processes without warning about service interruption, active sessions, or potential data loss. In an operational troubleshooting skill, users may copy-paste this command directly, making unintended disruption reasonably likely.
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
**Symptoms:** Session history not loading, "chat.history" errors in logs, blank chat in UI
**Fix sequence:**
1. Check sessions file: `ls -la ~/.openclaw/agents/main/sessions/`
2. Check for JSON corruption: `python3 -m json.tool ~/.openclaw/agents/main/sessions/sessions.json`
3. Gateway restart clears in-memory session state: `openclaw gateway restart`
No suspicious patterns detected.