Back to skill

Security audit

OpenClaw Power Ops

Security checks for vulnerabilities and agentic risk

Overview

This is a legitimate OpenClaw administration reference, but it needs review because it gives broad high-impact operations, destructive fixes, and token-handling examples without enough scoping or warnings.

Review this skill before installing it in environments where OpenClaw controls real channels, agents, credentials, or gateway access. Treat its commands as operator references, not automatic actions: confirm destructive commands, avoid putting tokens directly in shell commands, back up configuration before --fix operations, and adapt or remove the hard-coded personal environment notes.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
references/cli-cheatsheet.md:17
Finding
Telegram Bot Token Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `references/cli-cheatsheet.md`, line 17 **Vulnerability Type**: Secret exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```bash openclaw channels add --channel telegram --token <bot-token> ``` ### Technical Analysis The documented command instructs users to provide a Telegram bot token directly as a command-line argument. When the placeholder is replaced with an actual token, the secret can be exposed through: - Shell history files if the command is entered interactively. - Process inspection utilities while the command is running. - Operating-system auditing and endpoint-monitoring logs. - Terminal session recording or command telemetry. - Diagnostic output that captures the invoked command. Command-line arguments are not an appropriate secret-transfer mechanism because they may be observable by systems and principals other than the intended process. ### Attack Path 1. An administrator follows the documented procedure and replaces `<bot-token>` with a valid Telegram bot token. 2. The command containing the token is recorded in shell history, terminal telemetry, audit logs, or process information. 3. A local user, support operator, monitoring service, or attacker with access to those records retrieves the token. 4. The attacker uses the token against the Telegram Bot API. 5. The attacker can impersonate or operate the affected bot within the permissions and functionality granted to that bot. ### Impact Assessment Exposure grants control associated with the compromised Telegram bot token. Depending on the bot configuration, an attacker may send messages as the bot, inspect available bot updates, disrupt legitimate operation, or interact with OpenClaw workflows connected to the bot. The impact is limited to the affected bot and any downstream systems that trust its messages, but those downstream integrations may expand the practical scope. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Prefer a protected token file supported by the CLI, with ownership restricted to the OpenClaw service account and permissions set to `0600`. - If available, use an interactive secret prompt that disables terminal echo. - Alternatively, pass the token through standard input without including it in the process argument list. - Clearly warn users not to enter bot tokens directly into commands that may be retained in shell history. - Document secure token rotation procedures. - After suspected exposure, revoke the existing Telegram token, generate a replacement, update the protected credential source, and remove the old command from shell history and relevant logs where feasible. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/security-audit.md:36
Finding
Gateway Authentication Token Exposed in Process Arguments and Plaintext Configuration<![CDATA[ ## Vulnerability Details **File Location**: `references/security-audit.md`, line 36 **Vulnerability Type**: Plaintext authentication-token handling **Risk Level**: Medium ### Vulnerable Code ```bash openclaw config set gateway.auth.mode "token" && openclaw config set gateway.auth.token "$(openssl rand -base64 32)" ``` ### Technical Analysis The shell expands `$(openssl rand -base64 32)` before launching the second `openclaw` process. Consequently, the generated gateway bearer token is supplied to that process as a command-line argument and may briefly be visible through process inspection, operating-system auditing, endpoint telemetry, or command execution logging. The command also writes the bearer token to the `gateway.auth.token` configuration field. Unless OpenClaw independently encrypts or externalizes that field, this creates a plaintext credential in configuration. This procedure conflicts with the same reference document's recommendation to migrate plaintext secrets to a credential store, environment-based mechanism, or protected token file. Although ordinary shell history will generally retain the literal command substitution rather than the generated token, the expanded token can still be captured from the running process or execution telemetry. ### Attack Path 1. An administrator executes the documented remediation command. 2. The shell generates a bearer token and expands it into the argument list for `openclaw config set`. 3. A local observer, audit subsystem, endpoint-monitoring product, or compromised process captures the expanded command-line argument. 4. Alternatively, an attacker with read access to the OpenClaw configuration retrieves the stored token. 5. The attacker presents the recovered bearer token to the OpenClaw gateway. 6. If the gateway is reachable and the token remains valid, the attacker authenticates with the privileges granted by gateway token authentication. ### Impact Assessment A recovered gateway bearer to ...[truncated 467 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Store the gateway token in a dedicated credential store or protected token file rather than a normal configuration field. - Restrict token-file ownership to the OpenClaw service account and set permissions to `0600`; set the containing credential directory to `0700`. - Use an interactive hidden prompt or standard input so the generated secret does not appear in process arguments. - If OpenClaw supports environment-variable references, configure a reference rather than persisting the resolved secret in `openclaw.json`. - Restrict gateway listening interfaces and firewall access so possession of the token is not the only security boundary. - Ensure configuration files, backups, logs, and diagnostic bundles containing credentials are inaccessible to unauthorized users. - Rotate the gateway token after any suspected disclosure and restart the gateway using the documented post-change procedure. - Verify the final configuration with `openclaw security audit --deep` without printing the token. ]]>
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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The skill description includes broad trigger phrases such as 'any OpenClaw administrative task,' 'set up OpenClaw,' and 'fix the gateway,' which can cause the skill to activate for high-impact operational requests without enough narrowing or confirmation. In an administrative skill that can influence configuration, channels, models, and security posture, overbroad routing increases the chance of unsafe or unintended privileged actions.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill recommends auto-remediation commands such as 'openclaw doctor --fix' and 'openclaw security audit --deep --fix' without warning that they may modify system configuration or change runtime state. In an ops-focused skill, presenting self-modifying commands as routine diagnostics can lead to unintended changes, service disruption, or security regressions if an agent or operator runs them automatically.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This markdown file includes `openclaw channels remove --channel telegram --delete`, which appears to remove a channel and explicitly delete associated configuration, but the surrounding text provides no warning about the action's destructive effect. For markdown files, safety-impacting behaviors that could affect system configuration or user data should be accompanied by a clear warning.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The cheat sheet documents `openclaw agents delete <agent-id>` with no surrounding caution about deleting an agent. In markdown guidance, destructive operations that can affect system state or user-managed configuration should include a visible warning so users understand the impact before executing them.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The cheat sheet includes token-handling commands such as setup-token and paste-token without any guidance on protecting credentials from shell history, terminal logging, screen sharing, or audit logs. In an ops context, this increases the likelihood of credential exposure, which could enable unauthorized access to model providers and downstream service abuse.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### High

4. **Control UI wildcard origins** (`allowedOrigins: ["*"]`) — CSRF risk. Restrict to localhost.
5. **World-readable credentials** — WhatsApp session files at 644. Fix: `chmod 600`.
6. **Unencrypted node communication** — Set `tls: true` in `node.json`.

### Medium
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### High

4. **Control UI wildcard origins** (`allowedOrigins: ["*"]`) — CSRF risk. Restrict to localhost.
5. **World-readable credentials** — WhatsApp session files at 644. Fix: `chmod 600`.
6. **Unencrypted node communication** — Set `tls: true` in `node.json`.

### Medium
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Unsafe Defaults

Medium
Category
Tool Misuse
Content
### High

4. **Control UI wildcard origins** (`allowedOrigins: ["*"]`) — CSRF risk. Restrict to localhost.
5. **World-readable credentials** — WhatsApp session files at 644. Fix: `chmod 600`.
6. **Unencrypted node communication** — Set `tls: true` in `node.json`.

### Medium
Confidence
99% confidence
Finding
This is a real vulnerability being documented: world-readable credential/session files expose secrets to any local user or process with filesystem access. In an administrative OpenClaw context, such files may contain bot tokens or session material that can enable account takeover, impersonation, or lateral movement.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### Medium

7. **Permissive directory modes** — `credentials/`, `identity/`, `logs/`, `browser/`, `skills/` at 755. Fix: `chmod 700`.
8. **Unrestricted subagent access** — `allowAgents: ["*"]` lets any agent spawn as any other. Scope to specific lists.
9. **Group bots not requiring @mention** — Responds to every message, wasting tokens.
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
### Medium

7. **Permissive directory modes** — `credentials/`, `identity/`, `logs/`, `browser/`, `skills/` at 755. Fix: `chmod 700`.
8. **Unrestricted subagent access** — `allowAgents: ["*"]` lets any agent spawn as any other. Scope to specific lists.
9. **Group bots not requiring @mention** — Responds to every message, wasting tokens.
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The example `openclaw config unset tools.web.search.apiKey` modifies a sensitive credential-related setting, but the cheat sheet provides no warning that it changes authentication behavior and may break dependent features. Even though this is an example, markdown that instructs users to alter sensitive config should disclose the operational impact.

Missing User Warnings

Low
Confidence
81% confidence
Finding
The gateway section lists `openclaw gateway stop` and `openclaw gateway restart` without mentioning that these commands interrupt service availability. In markdown skill documentation, operationally disruptive actions that affect system integrity or availability should include a brief warning.

Static analysis

No suspicious patterns detected.