security(cli): redact sensitive values in config get output#13777
Closed
SleuthCo wants to merge 1 commit intoopenclaw:mainfrom
Closed
security(cli): redact sensitive values in config get output#13777SleuthCo wants to merge 1 commit intoopenclaw:mainfrom
SleuthCo wants to merge 1 commit intoopenclaw:mainfrom
Conversation
The CLI `openclaw config get` command returned resolved secret values (API keys, tokens, passwords) without redaction. The gateway RPC `config.get` endpoint already applied `redactConfigSnapshot()`, but the CLI path bypassed it entirely. A sandboxed agent (or any local process) could read credentials via: openclaw config get channels.telegram.botToken Apply `redactConfigObject()` to the resolved config before extracting the requested path value, aligning CLI behaviour with the gateway. Fixes openclaw#13683 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Friendly ping — this is a small, focused fix that redacts secret values in |
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
Contributor
Author
|
Still active — awaiting maintainer review. Happy to address any feedback. |
Contributor
Author
|
Superseded by new PR against current HEAD — upstream refactored |
3 tasks
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
openclaw config getcommand returned resolved secret values (API keys, tokens, passwords) without any redactionconfig.getendpoint already appliedredactConfigSnapshot(), but the CLI path bypassed itopenclaw config get channels.telegram.botTokenredactConfigObject()to the resolved config before path extraction, aligning CLI with gateway behaviorChanges
src/cli/config-cli.ts: ImportredactConfigObjectand apply it to the config beforegetAtPath()in theconfig getactionTest plan
openclaw config set channels.telegram.botToken "secret-123"thenopenclaw config get channels.telegram.botToken— should return__OPENCLAW_REDACTED__instead ofsecret-123openclaw config get agents(non-sensitive path) still returns actual valuesredact-snapshot.test.tstests continue to passCloses #13683
🤖 Generated with Claude Code
Greptile Overview
Greptile Summary
Fixed a security vulnerability where
openclaw config getexposed sensitive credentials (API keys, tokens, passwords) without redaction. The CLI bypassed the redaction logic that was already in place for the gateway RPC endpoint.Key changes:
redactConfigObjectfromsrc/config/redact-snapshot.tsconfig getaction (lines 271-272)config.getRPC endpoint (which already usedredactConfigSnapshot())Impact:
openclaw config get channels.telegram.botTokenopenclaw config get agentscontinue to work normallyredactConfigObject()which replaces values matching sensitive key patterns (/token/i,/password/i,/secret/i,/api.?key/i) with__OPENCLAW_REDACTED__Confidence Score: 5/5
redactConfigObjectfunction is already used by the gateway RPC endpoint and has comprehensive test coverage (28 test cases inredact-snapshot.test.ts). The change only affects theconfig getcommand, leavingconfig setandconfig unsetunchanged (correctly, as they operate on the raw config for writes). No new logic was introduced, reducing risk of regressions.(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!