T09 · Insecure Skill Coding Practices
- Location
references/checklist.md:55- Finding
Diagnostic Commands Expose Plaintext Credentials and Secrets
- Content
View full analysis
/dev/null | grep -v ".jsonl:" | head -20 grep -rEn "sk-|password|secret|token" ~/.openclaw/logs/ 2>/dev/null | head -20 ``` `references/checklist.md:55`: ```bash # Check token length (expected: 64 hexadecimal characters / 256 bits) grep -E "gateway.*token|OPENCLAW_GATEWAY_TOKEN" ~/.openclaw/.env ``` `references/checklist.md:66-67`: ```bash # Scan for plaintext secrets grep -rEn "sk-|AKIA-|password|secret|token|private.key" ~/.openclaw/sessions/ 2>/dev/null grep -rEn "sk-|password|secret|token" ~/.openclaw/logs/ 2>/dev/null ``` `references/checklist.md:153`: ```bash echo "=== Log exposure ===" && grep -rEn "sk-|password|secret" ~/.openclaw/sessions/ 2>/dev/null | head -5 ``` ### Technical Analysis The diagnostic commands use recursive `grep` without redacting matched values or limiting output to filenames. Standard `grep -n` output contains the complete matching line, including any API key, gateway token, password, private-key material, or session secret found on that line. Accessing credential-related files can be justified for a security audit, but reading and displaying their plaintext values exceeds the minimum privilege and data access required to determine whether insecure secrets exist. Token strength can be checked without printing the token, and log scanning can report filenames, line numbers, counts, or redacted fingerprints. The output can enter the Agent conversation context, terminal scrollback, command-capture logs, generated reports, monitoring systems, or other records with weaker access controls than the original files. ### Attack Path 1 ...[truncated 1100 chars]- Remediation
View remediation
/dev/null ``` - If line-level diagnostics are necessary, perform redaction before output and disclose only a short fingerprint, never the complete value. - Check token length in a local process that emits only a Boolean result or character count. - Require explicit user consent before inspecting secret-bearing file contents. - Prevent findings containing matched secret text from being copied into reports or Agent conversation context. - Add regression tests using synthetic credentials and verify that no complete test credential appears in stdout or stderr. ]]>
