Skip to content

[PM-44942] fix: Stop logging secrets in identity token requests - #1612

Merged
dani-garcia merged 1 commit into
mainfrom
ps/PM-44942-redact-token-request-logs
Oct 14, 2026
Merged

dani-garcia merged 1 commit into
mainfrom
ps/PM-44942-redact-token-request-logs

Conversation

@dani-garcia

@dani-garcia dani-garcia commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-44942

πŸ“” Objective

The four identity token request constructors in bitwarden-core logged the whole request with debug!(?obj, "initializing"), which wrote the master password hash, API key and access token client secrets, and the auth request access code to debug logs. These were test-only but not useful, so we're removing them for hygiene reasons.

@dani-garcia dani-garcia added the ai-review Request a Claude code review label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

πŸ€– Bitwarden Claude Code Review

Overall Assessment: APPROVE

This PR removes the debug!(?obj, "initializing") calls from four identity token request constructors in bitwarden-core (access token, API key, auth request, and password). It also drops Debug from all five request structs, including RenewTokenRequest, so their secrets (client secrets, auth request access code, master password hash, refresh token) can no longer be formatted into logs by accident. All five structs are pub(crate) and are only ever built through ::new(...).send(...), and send_identity_connect_request only needs serde::Serialize, so removing the derive does not break the build. No tracing usage remains in crates/bitwarden-core/src/auth/api/request/.

@dani-garcia
dani-garcia marked this pull request as ready for review October 13, 2026 15:15
@dani-garcia
dani-garcia requested a review from a team as a code owner October 13, 2026 15:15
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

πŸ” SDK Breaking Change Detection

SDK Version: ps/PM-44942-redact-token-request-logs (7d46337)

⚠️ If breaking changes are detected, a corresponding pull request addressing them must be ready for merge in the affected client repository.

Client Status Details
android ❌ Breaking changes detected Compilation failed with new SDK version. A corresponding pull request addressing the breaking changes must be ready for merge in bitwarden/android. - View Details
typescript βœ… No breaking changes detected Compilation passed with new SDK version - View Details

Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm.
Results update as workflows complete.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
βœ… Project coverage is 87.66%. Comparing base (2f761f9) to head (7d46337).

Files with missing lines Patch % Lines
...src/auth/api/request/auth_request_token_request.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1612   +/-   ##
=======================================
  Coverage   87.66%   87.66%           
=======================================
  Files         619      619           
  Lines       87723    87714    -9     
=======================================
- Hits        76899    76895    -4     
+ Misses      10824    10819    -5     

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dani-garcia
dani-garcia merged commit 1fc34e4 into main Oct 14, 2026
76 of 79 checks passed
@dani-garcia
dani-garcia deleted the ps/PM-44942-redact-token-request-logs branch October 14, 2026 07:48
bw-ghapp Bot added a commit to bitwarden/sdk-swift that referenced this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants