Description
The config tamper detection system (config-audit.jsonl) records full CLI argument vectors when config changes are detected. These argv entries contain plaintext secrets (gateway tokens, bot tokens, API keys) that were passed as command-line arguments or present in the process environment.
A security audit log that leaks credentials is counterproductive.
Steps to Reproduce
- Have config tamper detection enabled (default behavior)
- Make any config change that triggers an audit entry
- Inspect
~/.openclaw/logs/config-audit.jsonl
- Observe full CLI argv including plaintext tokens in logged entries
Expected Behavior
Audit log entries should:
- Record the SHA-256 hash of config changes (already does this correctly)
- Record suspicious signature detection (already does this correctly)
- NOT include raw CLI argv containing plaintext secrets
- Either omit argv entirely, or scrub known secret patterns before logging
Actual Behavior
Full argv arrays are logged, including values like:
- Gateway auth tokens
- Telegram bot tokens
- Any environment variables passed via CLI
Impact
- Credential exposure at rest — anyone with read access to the logs directory can extract live credentials
- Ironic for a security control — the mechanism designed to detect config tampering is itself a credential leak vector
- Credentials persist in the log file indefinitely unless manually scrubbed
Suggested Fix
- Strip argv entries from audit log writes, or
- Apply the same
redactSensitive patterns used elsewhere to scrub argv before logging, or
- Replace literal values with hashes/redaction markers (e.g.,
--token=[REDACTED:sha256:a1b2...])
Workaround
Manual scrub script that post-processes the log file:
// Replace strings >20 chars matching token/key patterns with [REDACTED]
We wrote one (scrub-config-audit-log.js) but this should be fixed at the source.
Labels
bug, security, logging
Description
The config tamper detection system (
config-audit.jsonl) records full CLI argument vectors when config changes are detected. These argv entries contain plaintext secrets (gateway tokens, bot tokens, API keys) that were passed as command-line arguments or present in the process environment.A security audit log that leaks credentials is counterproductive.
Steps to Reproduce
~/.openclaw/logs/config-audit.jsonlExpected Behavior
Audit log entries should:
Actual Behavior
Full argv arrays are logged, including values like:
Impact
Suggested Fix
redactSensitivepatterns used elsewhere to scrub argv before logging, or--token=[REDACTED:sha256:a1b2...])Workaround
Manual scrub script that post-processes the log file:
// Replace strings >20 chars matching token/key patterns with [REDACTED]We wrote one (
scrub-config-audit-log.js) but this should be fixed at the source.Labels
bug,security,logging