Back to skill

Security audit

OpenClaw配置管理最佳实践

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent OpenClaw configuration guide, but it directs agents to read complete credential-bearing configuration before and after changes without scoping or redaction guidance.

Install only if you are comfortable with an agent reading and modifying OpenClaw configuration. Before use, require scoped config reads when possible, redact API keys and bot/gateway tokens from outputs, and confirm each patch before applying it. Treat any full config output as sensitive.

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:19
Finding
Unnecessarily Broad Retrieval of Credential-Bearing Configuration## Vulnerability Details **File Location**: `SKILL.md:19-48`, `SKILL.md:89-94`, `references/common-paths.md:10-17`, `references/common-paths.md:39-82`, and `references/common-paths.md:111-119` **Vulnerability Type**: Excessive access to sensitive configuration **Risk Level**: Medium The skill directs the agent to retrieve the complete OpenClaw configuration before and after every modification, even when the requested operation concerns only one configuration field. Relevant command: ```text gateway config.get ``` The referenced configuration can contain credentials such as: ```json { "apiKey": "sk-...", "token": "YOUR_BOT_TOKEN", "token": "YOUR_GATEWAY_TOKEN" } ``` The recommended modification workflow also uses: ```text gateway config.patch { "channels": { "discord": { "enabled": true, "token": "YOUR_TOKEN" } } } ``` ### Technical Analysis Retrieving an entire configuration object for a narrowly scoped change violates the principle of least privilege. The documented configuration structure includes provider API keys, channel tokens, and gateway authentication tokens. Consequently, a full `gateway config.get` response may expose credentials unrelated to the user's requested operation. If the gateway does not automatically redact secrets, these values can enter the agent context, tool logs, conversation transcripts, debugging records, or other downstream processing systems. The skill provides no instruction to request only a configuration subtree, redact credentials, suppress sensitive output, or obtain confirmation before reading the complete configuration. This issue does not independently grant new operating-system privileges and does not contain an exfiltration mechanism. Exploitation is limited to the configuration-read privileges already held by the agent or gateway session. The practical severity therefore depends on the gateway's authorization controls ...[truncated 1440 chars]
Remediation
## Remediation Suggestions 1. Replace mandatory full-configuration retrieval with path-scoped or subtree-scoped reads whenever the gateway supports them. 2. Retrieve only the configuration section required for the requested change, such as `channels.discord`, rather than the complete configuration. 3. Explicitly require secret redaction for API keys, bot tokens, gateway tokens, passwords, and authorization headers. 4. Do not reproduce credential values in chat responses, logs, validation output, or error messages. 5. Validate only the modified subtree after applying a patch instead of retrieving the entire configuration again. 6. If full retrieval is technically unavoidable, require explicit operator confirmation and ensure the response is processed through a redaction layer before entering agent context. 7. Use secret references or environment-variable placeholders instead of plaintext credential values where OpenClaw supports them. 8. Document credential rotation procedures for cases where configuration output may have been stored in transcripts or logs. 9. Restrict `config.get` and `config.patch` through gateway authorization policies so the agent can access only configuration namespaces necessary for its assigned role.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The skill instructions, warnings, and examples are presented only in Chinese, which can impose a language choice on users without opt-in. The file does not indicate that this skill is intended solely for a Chinese-speaking or region-specific audience, nor does it offer an alternative language.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The documentation includes realistic secret-bearing configuration fields such as apiKey, bot tokens, and gateway tokens, but provides no warning about secret handling, storage, or avoiding commits to source control. In a configuration guide skill, this omission can normalize copying live credentials into shared files or chat transcripts, increasing the chance of accidental exposure.

External Transmission

Medium
Category
Data Exfiltration
Content
"models": {
    "providers": {
      "<provider-name>": {
        "baseUrl": "https://api.example.com/v1",
        "apiKey": "sk-...",
        "api": "openai-completions",
        "models": [
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.