T09 · Insecure Skill Coding Practices
- Location
SKILL.md:215- Finding
Unredacted Full Configuration Ingestion May Expose Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 215–220
Vulnerability Type: Sensitive configuration exposure through an overbroad read operation
Risk Level: MediumVulnerable Code
markdown 1. **Read** current config: `cat ~/.openclaw/openclaw.json` or `openclaw config get <key>` 2. **Backup**: `cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.bak-$(date +%Y%m%d-%H%M%S)` 3. **Edit** individual keys (or use `openclaw config set <key> <value>`) 4. **Validate**: `openclaw config validate` 5. **Restart only if needed**: most config hot-reloads automatically. See config-map.md for what requires `openclaw gateway restart`.Technical Analysis
The safe-editing workflow permits the agent to execute
cat ~/.openclaw/openclaw.json, which places the complete configuration file into command output and potentially into the agent context, conversation transcript, tool logs, or other retained execution records.Although the skill explicitly prohibits reading
~/.openclaw/secrets.jsonand~/.openclaw/.env,openclaw.jsonmay itself contain inline gateway tokens, provider credentials, OAuth material, plugin API keys, remote gateway tokens, or other private configuration. Reading the entire file is therefore broader than necessary for routine single-key diagnosis or modification and conflicts with the skill's otherwise restrictive secret-handling policy.The safer alternative shown in the same line,
openclaw config get <key>, does not eliminate the issue because the workflow presents full-file ingestion as an equally valid default. No automatic upload or confirmed external exfiltration mechanism was found; the vulnerability is the unnecessary disclosure of sensitive data to the agent and its surrounding logging or retention systems.Attack Path
- A user asks the agent to diagnose or change an individual OpenClaw setting.
- The agent follows the documented mand ...[truncated 1615 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
cat ~/.openclaw/openclaw.jsonfrom the default workflow. - Require narrowly scoped reads such as:
bash openclaw config get <specific-key> - If full-file inspection is genuinely necessary, obtain explicit user approval and explain that the file may contain inline credentials.
- Use a local redaction process that suppresses values associated with names such as
token,secret,password,apiKey,authorization,credential, and private-key fields before output reaches the agent. - Avoid printing redacted secret fragments, lengths, prefixes, or suffixes unless they are strictly required for diagnosis.
- Update the workflow to state that configuration backups must remain local, use restrictive file permissions, and must not be attached to external support requests.
- Add an explicit policy that only the minimum configuration subtree necessary for the current operation may be read.
- Add a consistency check ensuring that all configuration-reading guidance follows the same safeguards already applied to
.env,secrets.json, sessions, and workspaces.
- Remove
