T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:19
- Finding
- Raw Gateway Tokens Are Disclosed in Console Output## Vulnerability Details **File Location**: `SKILL.md`, lines 19–29 **Vulnerability Type**: Sensitive credential exposure through console output **Risk Level**: High **Vulnerable Code**: ```powershell # Check all token surfaces $cfg = Get-Content "$HOME/.openclaw/openclaw.json" -Raw | ConvertFrom-Json $auth = $cfg.gateway.auth.token $remote = $cfg.gateway.remote.token $service = $env:OPENCLAW_GATEWAY_TOKEN "auth.token = $auth" "remote.token = $remote" "service.token = $service" if ($auth -and $remote -and $auth -ne $remote) { ``` ### Technical Analysis The audit workflow reads gateway credentials from the OpenClaw configuration and the `OPENCLAW_GATEWAY_TOKEN` environment variable, then interpolates their complete values into console output. This exposes reusable authentication material to terminal history, CI logs, Agent transcripts, monitoring systems, screenshots, and any other mechanism that captures standard output. This behavior directly contradicts the skill's own privacy guidance at lines 68–69, which states that actual token values must never be logged and should be redacted. Token equality can be determined entirely in memory; displaying the credentials is unnecessary for the diagnostic task. ### Attack Path 1. An operator or automated Agent invokes the documented token-audit workflow. 2. PowerShell loads gateway tokens from the configuration file and environment. 3. The three string expressions print the complete token values. 4. The output is retained in a terminal transcript, CI log, support record, Agent conversation, or screenshot. 5. A party with access to that retained output copies a disclosed token. 6. The party presents the token to gateway or CLI endpoints that accept it. ### Impact Assessment Disclosure permits an unauthorized party to obtain the same gateway access granted by the exposed token. The precise privileges depend on the gateway's authorization model and token sco ...[truncated 406 chars]
- Remediation
- ## Remediation Suggestions - Remove every statement that prints a complete token. - Report only whether each token is present and whether the values match. - If a diagnostic identifier is necessary, display a non-reversible cryptographic fingerprint rather than a token substring. If compatibility requires redaction, reveal no more than the documented four-character prefix and clearly mark the remaining value as redacted. - Ensure exceptions and debug logs cannot serialize the configuration object or environment variable. - Treat any token previously exposed through this workflow as compromised: revoke it, generate a replacement, update authorized credential stores, and remove retained logs where feasible. - Add a regression check that fails when output contains any complete fixture token.
