Skip to content

config-audit.jsonl logs plaintext secrets in CLI argv #60826

@Belthezar46

Description

@Belthezar46

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

  1. Have config tamper detection enabled (default behavior)
  2. Make any config change that triggers an audit entry
  3. Inspect ~/.openclaw/logs/config-audit.jsonl
  4. 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

  1. Strip argv entries from audit log writes, or
  2. Apply the same redactSensitive patterns used elsewhere to scrub argv before logging, or
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions