security(cli): redact sensitive values in config get output#23654
Merged
vincentkoc merged 3 commits intoopenclaw:mainfrom Feb 23, 2026
Merged
security(cli): redact sensitive values in config get output#23654vincentkoc merged 3 commits intoopenclaw:mainfrom
vincentkoc merged 3 commits intoopenclaw:mainfrom
Conversation
`runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@vincentkoc — small security follow-up to the prototype pollution fix you merged in #22213.
This is a 1-line fix using the existing |
vincentkoc
approved these changes
Feb 23, 2026
Member
vincentkoc
left a comment
There was a problem hiding this comment.
Looks good after validation.
I pushed two follow-ups to this PR branch:
- Added a changelog entry under
2026.2.22 (Unreleased) -> Fixes - Added a regression test in
src/cli/config-cli.test.tsfor redactedconfig getoutput
Thanks @SleuthCo.
carlosrivera
pushed a commit
to myascendai/meshiclaw
that referenced
this pull request
Feb 23, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
gabrielkoo
pushed a commit
to gabrielkoo/openclaw
that referenced
this pull request
Feb 23, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
xianfeng92
pushed a commit
to xianfeng92/openclaw
that referenced
this pull request
Feb 24, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
6 tasks
brianleach
pushed a commit
to brianleach/openclaw
that referenced
this pull request
Feb 26, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 26, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> (cherry picked from commit 9c87b53) # Conflicts: # CHANGELOG.md # src/cli/config-cli.test.ts # src/cli/config-cli.ts
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Vincent Koc <vincentkoc@ieee.org> (cherry picked from commit 9c87b53) # Conflicts: # CHANGELOG.md # src/cli/config-cli.test.ts # src/cli/config-cli.ts
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…#23654) * security(cli): redact sensitive values in config get output `runConfigGet()` reads raw config values but never applies redaction before printing. When a user runs `openclaw config get gateway.token` the real credential is printed to the terminal, leaking it into shell history, scrollback buffers, and screenshots. Use the existing `redactConfigObject()` (from redact-snapshot.ts, already used by the Web UI path) to scrub sensitive fields before `getAtPath()` resolves the requested key. Fixes openclaw#13683 * CLI/Config: add redaction regression test and changelog --------- Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runConfigGet()reads raw config values but never applies redaction before printing. Runningopenclaw config get gateway.tokenleaks the real credential to the terminal — visible in shell history, scrollback, and screenshots.This is a 1-line fix using the existing
redactConfigObject()fromredact-snapshot.ts(already used by the Web UI path) to scrub sensitive fields before output.Supersedes #13777 (rebased against current HEAD after upstream refactored
config getintorunConfigGet()).Fixes #13683
Changes
redactConfigObjectfrom../config/redact-snapshot.jsredactConfigObject(snapshot.config)beforegetAtPath()inrunConfigGet()Test plan
openclaw config get gateway.token→ prints__OPENCLAW_REDACTED__instead of real tokenopenclaw config get gateway.token --json→ prints"__OPENCLAW_REDACTED__"openclaw config get agents→ non-sensitive paths return real values unchanged🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Greptile Summary
This PR fixes a security vulnerability where
openclaw config getcommands leaked sensitive credentials (tokens, passwords, API keys) to terminal output, shell history, and screenshots. The fix applies the existingredactConfigObject()function fromsrc/config/redact-snapshot.tsbefore retrieving the config value, ensuring sensitive fields are replaced with__OPENCLAW_REDACTED__sentinel values.redactConfigObjectfrom../config/redact-snapshot.jsinsrc/cli/config-cli.ts:4snapshot.configbeforegetAtPath()inrunConfigGet()atsrc/cli/config-cli.ts:236-237token,password,secret,apiKey(with exceptions for fields likemaxTokens)Confidence Score: 5/5
redactConfigObject()) already used by the Web UI and gateway config endpoints. The change is minimal, focused, and follows established patterns in the codebase. The redaction function has comprehensive test coverage and handles edge cases (environment variable placeholders, whitelisted fields likemaxTokens). No breaking changes or performance concerns.Last reviewed commit: 92dace9