Skip to content

fix(security): stop logging partial token values#1158

Merged
Mossaka merged 1 commit intomainfrom
fix/054-token-logging-leak
Mar 5, 2026
Merged

fix(security): stop logging partial token values#1158
Mossaka merged 1 commit intomainfrom
fix/054-token-logging-leak

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Mar 5, 2026

Summary

  • Remove format_token_value() from both C and Rust one-shot-token implementations which leaked the first 4 characters of sensitive tokens to stderr
  • Replace with token length logging (length: N) which provides useful debug info without exposing secret material
  • Update integration tests and documentation to match new log format

Details

The one-shot-token LD_PRELOAD library was logging partial token values like ghp_... and sk-a... when debug mode was enabled. While this only occurs with AWF_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

  • All 831 unit tests pass
  • Lint passes (0 errors)
  • Integration test assertions updated to expect (length: N) format
  • Both C (one-shot-token.c) and Rust (src/lib.rs) implementations updated
  • README examples updated

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 5, 2026 19:40
@Mossaka Mossaka merged commit 143c9c0 into main Mar 5, 2026
7 of 8 checks passed
@Mossaka Mossaka deleted the fix/054-token-logging-leak branch March 5, 2026 19:40
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 82.28% 82.42% 📈 +0.14%
Statements 82.25% 82.39% 📈 +0.14%
Functions 82.60% 82.60% ➡️ +0.00%
Branches 74.43% 74.52% 📈 +0.09%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/docker-manager.ts 83.0% → 83.6% (+0.55%) 82.4% → 82.9% (+0.53%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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.

[Security] One-shot token logs partial token values (first 4 chars) to stderr

1 participant