Mask API keys more aggressively in status and session messages#24409
Merged
steipete merged 2 commits intoopenclaw:mainfrom Feb 23, 2026
Merged
Mask API keys more aggressively in status and session messages#24409steipete merged 2 commits intoopenclaw:mainfrom
steipete merged 2 commits intoopenclaw:mainfrom
Conversation
026b235 to
fbd159c
Compare
Contributor
|
Landed via temp rebase onto
Thanks @Clawborn! |
iamjulio
pushed a commit
to NeuroGym-Dev/openclaw
that referenced
this pull request
Feb 23, 2026
* upstream/main: (1467 commits) fix(doctor): use gateway health status for memory search key check (openclaw#22327) refactor: harden reset notice + cron delivery target flow refactor(exec): simplify env-prefixed wrapper modifier check fix(skills): support multiline frontmatter fallback without PyYAML fix(skills): make quick_validate work without PyYAML fix(exec): bind env-prefixed shell wrappers to full approval text fix(browser): derive relay auth token from gateway token in Chrome extension Browser relay: accept raw gateway token in extension auth fix(gateway): include platform and reason in node command rejection error CLI: fix gateway restart health ownership for child listener pids (openclaw#24696) docs: detail per-agent prompt caching configuration fix(config): tighten bedrock cache-retention type narrowing feat(agents): add per-agent stream params overrides for cache tuning (openclaw#17470) (thanks @rrenamed) fix(providers): support Bedrock Anthropic cacheRetention defaults/pass-through (openclaw#22303) (thanks @snese) fix(providers): disable Bedrock prompt caching for non-Anthropic models (openclaw#20866) (thanks @pierreeurope) docs(changelog): note /new and /reset auth-label removal (openclaw#24409) fix(reply): omit auth labels in /new and /reset docs(changelog): correct kimi issue references test(tools): fix kimi web_search mock typing feat(media): add moonshot video provider and wiring ... # Conflicts: # ui/src/ui/app-render.ts # ui/src/ui/controllers/agents.ts
carlosrivera
pushed a commit
to myascendai/meshiclaw
that referenced
this pull request
Feb 23, 2026
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
plgs2005
pushed a commit
to plgs2005/openclaw
that referenced
this pull request
Feb 24, 2026
margulans
pushed a commit
to margulans/Neiron-AI-assistant
that referenced
this pull request
Feb 25, 2026
brianleach
pushed a commit
to brianleach/openclaw
that referenced
this pull request
Feb 26, 2026
2 tasks
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 26, 2026
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
) (cherry picked from commit e40ee3c)
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
) (cherry picked from commit e40ee3c)
This was referenced Mar 4, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
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.
formatApiKeySnippetreveals the first 6 and last 6 characters of API keys in/new,/status, and model picker messages. In shared channels (Discord, Telegram groups), this exposes 12 characters of the key — enough to narrow brute-force search space or identify the full key for short-key providers.Reduced to showing only the first 4 characters plus a fixed
****mask. Users can still identify which key is active without credential exposure risk.Before:
sk-abc1…xyz789(12 chars exposed)After:
sk-a****(4 chars exposed)Added unit tests for the masking behavior.
Fixes #24384
Greptile Summary
Reduced API key exposure in status and session messages from 12 characters (first 6 + last 6) to 4 characters (first 4 only), eliminating trailing character disclosure. The fix properly addresses the security risk in shared channels like Discord and Telegram by changing the masking pattern from
sk-abc1…xyz789tosk-a****.The implementation:
formatApiKeySnippetinsrc/agents/model-auth-label.tsto show only the first 4 characters followed by****Note: There is a separate utility
maskApiKeyinsrc/utils/mask-api-key.tsthat still uses the vulnerable pattern (showing 8 chars prefix + 8 chars suffix). This utility is used in/models listand auth directive handling. Consider applying the same fix to that utility in a follow-up to ensure consistent security across all API key display contexts.Confidence Score: 5/5
Last reviewed commit: 026b235