Back to skill

Security audit

OpenClaw Secrets Hygiene

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent OpenClaw secrets-migration guide, but users should handle the suggested local secrets file and config edits carefully.

Install only if you intend to audit or migrate OpenClaw credentials. Before following the examples, back up affected config files, restrict permissions before adding real secrets, avoid pasting credentials into shared terminals, and rotate any keys that were previously stored in plaintext.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

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

md
### 2. OpenClaw SecretRef Format Nuances
- **JSON Pointer format:** References use `/secret-name` (JSON Pointer with leading slash)
- **secrets.json keys:** Use `"secret-name"` (NO leading slash in key names)
- **Correct pattern:** Reference `"/secret-name"` → Key `"secret-name"` in secrets.json
- **Provider reference:** Must match `filemain` provider name in openclaw.json

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

md
### 2. OpenClaw SecretRef Format Nuances
- **JSON Pointer format:** References use `/secret-name` (JSON Pointer with leading slash)
- **secrets.json keys:** Use `"secret-name"` (NO leading slash in key names)
- **Correct pattern:** Reference `"/secret-name"` → Key `"secret-name"` in secrets.json
- **Provider reference:** Must match `filemain` provider name in openclaw.json

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

md
### 2. OpenClaw SecretRef Format Nuances
- **JSON Pointer format:** References use `/secret-name` (JSON Pointer with leading slash)
- **secrets.json keys:** Use `"secret-name"` (NO leading slash in key names)
- **Correct pattern:** Reference `"/secret-name"` → Key `"secret-name"` in secrets.json
- **Provider reference:** Must match `filemain` provider name in openclaw.json

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

md
### 2. OpenClaw SecretRef Format Nuances
- **JSON Pointer format:** References use `/secret-name` (JSON Pointer with leading slash)
- **secrets.json keys:** Use `"secret-name"` (NO leading slash in key names)
- **Correct pattern:** Reference `"/secret-name"` → Key `"secret-name"` in secrets.json
- **Provider reference:** Must match `filemain` provider name in openclaw.json

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

md
### 2. OpenClaw SecretRef Format Nuances
- **JSON Pointer format:** References use `/secret-name` (JSON Pointer with leading slash)
- **secrets.json keys:** Use `"secret-name"` (NO leading slash in key names)
- **Correct pattern:** Reference `"/secret-name"` → Key `"secret-name"` in secrets.json
- **Provider reference:** Must match `filemain` provider name in openclaw.json

Credential Access

High
Category
Privilege Escalation
Confidence
84% confidence
Finding

The skill instructs users to create a centralized secrets.json file containing multiple sensitive credentials in plaintext at rest. Although this is intended for security improvement and later protected with file permissions, concentrating secrets into one file increases blast radius if the account or workstation is compromised and may normalize manual handling of secrets.

Content

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

bash
# 1. Create centralized secrets file
mkdir -p ~/.openclaw
cat > ~/.openclaw/secrets.json << 'EOF'
{
  "gateway-token": "REPLACE_WITH_TOKEN",
  "brave-api-key": "REPLACE_WITH_KEY",

Session Persistence

Medium
Category
Rogue Agent
Confidence
80% confidence
Finding

The workflow creates a persistent local secrets file under ~/.openclaw, which stores long-lived credentials on disk. Persistent secret storage can materially increase exposure through endpoint compromise, backups, shell history around population steps, or accidental inclusion in support bundles.

Content

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

Phase 2: Preparation

bash
# 1. Create centralized secrets file
mkdir -p ~/.openclaw
cat > ~/.openclaw/secrets.json << 'EOF'
{

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

md
"agent-openrouter-key": "REPLACE_WITH_KEY"
}
EOF
chmod 600 ~/.openclaw/secrets.json

# 2. Update openclaw.json with secret references
# Change plaintext values to:

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
89% confidence
Finding

The skill states that plaintext API keys in models.json may remain acceptable if files are merely in protected directories and not world-readable. This weakens security posture by endorsing plaintext secret retention based on filesystem placement alone, which is an unsafe default because user-level compromise, backups, or accidental sharing still expose the keys.

Content

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

md
### Acceptable Deferred Items
- models.json API keys may remain plaintext if:
  - Files are in protected agent directories (`~/.openclaw/agents/*/agent/`)
  - No world-readable permissions
  - Documented as technical debt

### Documentation Requirements

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The emergency fix script directly rewrites models.json in place without any backup, confirmation step, or warning that it modifies local configuration. In a security-remediation skill this is risky because an operator may copy-paste it into the wrong directory or corrupt configuration, causing loss of settings or service disruption during remediation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.