Skip to content

fix: redact secrets in /config show replies#2399

Open
BingqingLyu wants to merge 1 commit intomainfrom
fork-pr-65637-fix-65623-config-show-redaction
Open

fix: redact secrets in /config show replies#2399
BingqingLyu wants to merge 1 commit intomainfrom
fork-pr-65637-fix-65623-config-show-redaction

Conversation

@BingqingLyu
Copy link
Copy Markdown
Owner

@BingqingLyu BingqingLyu commented Apr 28, 2026

Fix Summary

/config show exposed the raw parsed config object directly in chat replies, so owner-triggered config inspection could leak gateway tokens, provider API keys, and channel secrets into message history. This patch routes both full-config and path-specific /config show responses through the existing schema-aware config redaction pipeline before rendering the JSON reply.

Issue Linkage

Fixes openclaw#65623

Security Snapshot

  • CVSS v3.1: 7.7 (High)
  • CVSS v4.0: 8.3 (High)

Implementation Details

Files Changed

  • src/auto-reply/reply/commands-config.ts (+6/-2)
  • src/auto-reply/reply/commands-gating.test.ts (+62/-0)

Technical Analysis

The vulnerable /config show path in handleConfigCommand cloned snapshot.parsed and serialized it directly into the chat response. The fix now loads runtime schema UI hints and applies redactConfigObject(...) before either subtree lookup or full-object rendering, so the chat-command path matches the existing redaction guarantees already used by config.get.

Validation Evidence

  • Command: pnpm test src/auto-reply/reply/commands-gating.test.ts
  • Status: passed

Risk and Compatibility

  • non-breaking; reply format is unchanged apart from replacing sensitive values with the standard redaction sentinel

AI-Assisted Disclosure

  • AI-assisted: yes
  • Model: github-copilot/gpt-5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /config show chat command returns unredacted config containing plaintext secrets

2 participants