T09 · Insecure Skill Coding Practices
- Location
SKILL.md:353- Finding
Raw Credential Disclosure Through Recursive Configuration Audit Command
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 353
Vulnerability Type: Sensitive information exposure
Risk Level: MediumVulnerable Code
bash # Deep search for all API keys (for audit) jq '.. | objects | .apiKey? // .token? // .password? | select(.)' ~/.openclaw/config.jsonTechnical Analysis
The documented
jqcommand recursively searches the OpenClaw configuration for fields namedapiKey,token, orpasswordand writes their raw values to standard output.Displaying secret values is not required to establish whether credentials exist. The command therefore exceeds the minimum access and disclosure necessary for a configuration audit. When an AI agent executes it, the output may also enter the agent's context, session transcript, terminal capture, debug logs, monitoring systems, or other downstream tools.
Although the Skill separately recommends environment-variable references, users may still have resolved or plaintext credentials in the configuration. The command does not redact, hash, or otherwise protect those values.
Attack Path
- A user has an API key, bot token, gateway token, or password stored in
~/.openclaw/config.json. - The Skill is used to audit the configuration.
- The agent follows the documented command at line 353.
jqrecursively finds matching fields and prints their complete values.- The command output is captured in an agent transcript, terminal log, observability system, or another accessible context.
- A party with access to that output obtains the credentials and reuses them against the associated services.
This issue does not itself transmit credentials to an attacker-controlled endpoint, but it materially increases their exposure and creates a practical disclosure channel.
Impact Assessment
An exposed credential grants the permissions assigned to that credential. Depending on the configuration, the impact may include:
- Unauthorized use of paid model-provider A ...[truncated 438 chars]
- A user has an API key, bot token, gateway token, or password stored in
- Remediation
View remediation
Remediation Suggestions
Replace the command with one that reports only matching configuration paths and never emits secret values:
bash jq -r ' paths(scalars) as $p | select( ($p[-1] | tostring) | test("^(apiKey|token|password|botToken|appToken)$"; "i") ) | $p | map(tostring) | join(".") ' ~/.openclaw/config.jsonApply the following additional hardening measures:
- Explicitly state that raw credentials must never be printed, logged, copied into agent context, or included in audit reports.
- If value inspection is unavoidable, redact all but a minimal suffix and perform it only with informed user approval.
- Prefer checking whether a secret is represented by an environment-variable reference rather than resolving or displaying it.
- Avoid commands such as
openclaw config get --jsonfor secret auditing unless the tool guarantees redaction. - Ensure configuration and audit-output files use restrictive permissions such as
0600. - Rotate any credential that has already appeared in command output, transcripts, or logs.
- Add examples of safe audit output containing field paths and status indicators such as
present,missing, oruses environment reference.
