openclaw - ✅(Solved) Fix config-audit.jsonl logs plaintext secrets in CLI argv [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60826Fetched 2026-04-08 02:46:44
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1referenced ×1

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.

Root Cause

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.

Fix Action

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.

PR fix notes

PR #60871: fix: redact sensitive CLI argv from config-audit.jsonl

Description (problem / solution / changelog)

Summary

The config tamper detection audit log (config-audit.jsonl) was recording full CLI argument vectors including plaintext gateway tokens, bot tokens, and API keys — making a security control itself a credential leak vector.

Fix

Added a redactArgv() helper function and SENSITIVE_ARGV_FLAGS constant in src/config/io.ts that scrubs known secret-bearing flag values before they are written to the audit log.

Flags redacted: --token, --bot-token, --app-token, --access-token, --gateway-token, --password, --api-key, --secret, --secret-key, --secret-input

Both --flag value and --flag=value forms are handled.

Changes

  • src/config/io.ts — added SENSITIVE_ARGV_FLAGS set and redactArgv() function; replaced all 3 audit-record argv: process.argv.slice(0, 8) writes with argv: redactArgv(process.argv).slice(0, 8)

Fixes openclaw/openclaw#60826

Changed files

  • src/config/io.ts (modified, +49/-3)

Code Example

// Replace strings >20 chars matching token/key patterns with [REDACTED]
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Modify the config tamper detection system to scrub or omit sensitive information from CLI argument vectors before logging to prevent credential exposure.

Guidance

  • Identify and apply existing redactSensitive patterns to scrub argv entries before logging to prevent plaintext secrets from being recorded.
  • Consider stripping argv entries from audit log writes altogether if not necessary for security auditing purposes.
  • Verify the fix by inspecting the config-audit.jsonl log file for the presence of plaintext secrets after making a config change.
  • Implement a temporary workaround using a manual scrub script, such as scrub-config-audit-log.js, to post-process and redact sensitive information from existing log files.

Example

// Example of applying redactSensitive patterns to scrub argv
const redactSensitive = (argv) => {
  // Apply existing redactSensitive patterns to scrub argv entries
  return argv.map((arg) => {
    if (arg.includes('token') || arg.includes('key')) {
      return '[REDACTED]';
    }
    return arg;
  });
};

Notes

The suggested fix should be applied at the source to prevent credential exposure, rather than relying on a manual workaround. The redactSensitive patterns should be reviewed and updated to ensure they effectively scrub all sensitive information.

Recommendation

Apply workaround: Implement a temporary manual scrub script, such as scrub-config-audit-log.js, to post-process and redact sensitive information from existing log files until a permanent fix can be applied.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING