fix(security): stop logging partial token values#1158
Merged
Conversation
Remove format_token_value() which leaked the first 4 characters of sensitive tokens to stderr. Replace with token length logging which provides useful debug info without exposing secret material. Fixes #758 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This was referenced Mar 5, 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.
Summary
format_token_value()from both C and Rust one-shot-token implementations which leaked the first 4 characters of sensitive tokens to stderrlength: N) which provides useful debug info without exposing secret materialDetails
The one-shot-token LD_PRELOAD library was logging partial token values like
ghp_...andsk-a...when debug mode was enabled. While this only occurs withAWF_ONE_SHOT_TOKEN_DEBUG=1, CI environments capture stderr logs which persist for 90 days, creating an unnecessary exposure of token prefixes that reveal token type information.Fixes #758
Test plan
(length: N)formatone-shot-token.c) and Rust (src/lib.rs) implementations updated🤖 Generated with Claude Code