Back to skill

Security audit

Openclaw Audit

Security checks for vulnerabilities and agentic risk

Overview

This audit skill has a legitimate OpenClaw security-audit purpose, but it asks the agent to inspect sensitive local OpenClaw secrets, auth, session, and workspace files more broadly than necessary.

Install only if you are comfortable with an agent inspecting local OpenClaw configuration, cron prompts, workspace instructions, auth topology, and session metadata. Before running it, require redaction and field-only extraction, do not allow secret values or full session contents into the report, and manually review any suggested deletions or archival actions before applying them.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:20
Finding

Overbroad Access to Sensitive OpenClaw Configuration and Session State

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20-29; additional session inspection instructions at lines 124-128
Vulnerability Type: T05: Unauthorized Access and Privilege Escalation
Risk Level: Medium

Vulnerable Instructions

markdown
1. Read `~/.openclaw/openclaw.json`
2. Read `~/.openclaw/cron/jobs.json` if it exists
3. Read `~/.openclaw/secrets.json` (path only, never the values)
4. Read `~/.openclaw/workspace/AGENTS.md` if present
5. Read `~/.openclaw/workspace/HEARTBEAT.md` if present
6. Check plugin status: `openclaw status 2>&1 | head -30`
7. Check channel status: `openclaw channels status --probe 2>&1`
8. Run the built-in security audit: `openclaw security audit 2>&1`
9. Check `~/.openclaw/workspace/state/sessions/` for stale ACP session files
10. Cross-reference fallback model providers with `auth.profiles` for orphans
markdown
#### 17. ACP zombie session state (CRITICAL)
- List `~/.openclaw/workspace/state/sessions/*.json` and `~/.openclaw/agents/*/sessions/sessions.json`
- Any session with `closed: false` whose `pid` is no longer running is a zombie
- ALSO check `~/.openclaw/<channel>/thread-bindings-default.json` — these can silently re-route inbound messages to dead ACP subprocesses for 24h+
- **Fix:** archive the stale session state files, delete thread-bindings; if ACP is disabled (`acp.enabled: false`), the entire `~/.openclaw/workspace/state/sessions/` directory should be empty.

Technical Analysis

The Skill instructs the Agent to read multiple security-sensitive files, including the secret store, Agent instruction files, authentication configuration, cron payloads, channel bindings, and session records. This exceeds least privilege because the audit only needs selected metadata, such as whether a secret reference is object-shaped, whether a provider profile exists, and whether a session PID remains active.

The inst ...[truncated 1933 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the instruction to read secrets.json. Check only its existence, ownership, permissions, and non-secret schema metadata through a trusted redacting utility.
  2. Use field-level extraction for configuration files. Permit only the exact keys required by each check and redact values associated with names such as apiKey, token, secret, password, and credential.
  3. For session records, extract only pid, closed, timestamps, and non-sensitive identifiers. Never load message bodies or transcripts into model context.
  4. Require explicit user approval before inspecting AGENTS.md, HEARTBEAT.md, session stores, or channel-binding files.
  5. Treat all inspected file content as untrusted data and explicitly prohibit following instructions found inside configuration, workspace, cron, or session files.
  6. Perform secret-pattern checks locally using a deterministic scanner that returns only file paths, field paths, and redacted match types.
  7. Ensure generated reports never include raw credentials, complete session payloads, or unrelated workspace instructions.
  8. Document the minimum filesystem permissions required and run the audit under a restricted account with access only to the necessary OpenClaw metadata.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (5)

Credential Access

High
Category
Privilege Escalation
Confidence
82% confidence
Finding

The skill instructs the agent to access ~/.openclaw/secrets.json, even with the caveat 'path only, never the values.' Accessing a secrets store location is sensitive because implementations may still open, inspect, or mishandle the file, and the skill does not provide a strict mechanism that prevents reading secret material during execution.

Content

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

md
1. Read `~/.openclaw/openclaw.json`
2. Read `~/.openclaw/cron/jobs.json` if it exists
3. Read `~/.openclaw/secrets.json` (path only, never the values)
4. Read `~/.openclaw/workspace/AGENTS.md` if present
5. Read `~/.openclaw/workspace/HEARTBEAT.md` if present
6. Check plugin status: `openclaw status 2>&1 | head -30`

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

13. Inlined API keys (CRITICAL)

  • Scan openclaw.json for plaintext patterns: sk-or-v1-, sk-svcacct-, tvly-, sk-ant-, xoxb-, xapp-, etc.
  • Any value matching these in env.vars, models.providers.*.apiKey, or plugins.entries.*.config.*.apiKey is a leak risk.
  • Fix: every secret should be a SecretRef pointing to a secrets.json provider. Pattern:
    json
    "apiKey": { "source": "file", "provider": "local", "id": "/PROVIDER_API_KEY" }
    

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file defines when the skill should be used, so SQP-1 applies. The phrase is subjective and lacks boundaries or exclusion conditions, making activation scope unclear and increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This is an ambiguous activation condition in a markdown skill description. It does not clearly distinguish OpenClaw-specific audit cases from ordinary user uncertainty, so the skill's trigger scope remains too broad.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% 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 140)May include surrounding context.

md
#### 19. Slack tool-progress + workspace-fs (CRITICAL combo)
- If `channels.slack.streaming.preview.toolProgress` is undefined or true, AND `channels.slack.groupPolicy: "open"`, AND `tools.fs.workspaceOnly: false`:
  - Tool calls (e.g., `Working… exec list files in ~/projects → ls -la ~ ...`) leak into channel posts
  - And anyone in the workspace can prompt-inject Penny into reading the home directory
- **Fix:**
  - Set `channels.slack.streaming.preview.toolProgress: false`

Static analysis

No suspicious patterns detected.