Skip to content

Conversation

@JaredSnider-Bitwarden
Copy link
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden commented Dec 2, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-3287
Clients PR: bitwarden/clients#17794
Depends on #6627 merging first.

📔 Objective

To remove the 2 year old, deprecated ResetMasterPassword property which used to indicate if a user had a master password set or not. It has been replaced by the UserDecryptionOptions property. I also confirmed with mobile that this removal will not cause issues for them.

📸 Screenshots

n/a

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes
@JaredSnider-Bitwarden JaredSnider-Bitwarden changed the title PM-3287 - Remove deprecated resetMasterPassword property from Identit… Auth/PM-3287 - Remove deprecated ResetMasterPassword property from IdentityTokenResponse Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

Logo
Checkmarx One – Scan Summary & Details01ffd723-e91c-449d-8e50-7ae49c67babe

New Issues (2)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1519
detailsMethod at line 1519 of /src/Api/Vault/Controllers/CiphersController.cs gets a parameter from a user request from id. This parameter value flows ...
ID: dMGF5qNfAN72zlvQcA1MgbhHv%2Fc%3D
Attack Vector
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1395
detailsMethod at line 1395 of /src/Api/Vault/Controllers/CiphersController.cs gets a parameter from a user request from id. This parameter value flows ...
ID: iOCFr11iI9znjDnv46yLfiS4aDY%3D
Attack Vector
Fixed Issues (2)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs: 97
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 300
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.40%. Comparing base (b0f6b22) to head (14914e3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@ ## main #6676 +/- ## ========================================== - Coverage 53.41% 53.40% -0.01%  ========================================== Files 1917 1917 Lines 85467 85456 -11 Branches 7667 7665 -2 ========================================== - Hits 45651 45638 -13  - Misses 38048 38053 +5  + Partials 1768 1765 -3 

☔ View full report in Codecov by Sentry.
📢 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.
ike-kottlowski
ike-kottlowski previously approved these changes Dec 2, 2025
Base automatically changed from auth/pm-3537/remove-key-connector-url-from-id-token-response to main December 3, 2025 21:57
@JaredSnider-Bitwarden JaredSnider-Bitwarden dismissed ike-kottlowski’s stale review December 3, 2025 21:57

The base branch was changed.

@JaredSnider-Bitwarden JaredSnider-Bitwarden force-pushed the auth/pm-3287/tde-cleanup-remove-reset-master-password-from-token-response branch from d57d83e to 14914e3 Compare December 3, 2025 22:14
@claude
Copy link
Contributor

claude bot commented Dec 3, 2025

Claude finished @JaredSnider-Bitwarden's task —— View job


PR Review: Remove ResetMasterPassword Property

Task List

  • Read changed files to understand modifications
  • Search for any remaining references to ResetMasterPassword
  • Analyze security implications
  • Verify test coverage
  • Provide comprehensive review feedback

Review Summary

This PR successfully removes the deprecated ResetMasterPassword property from the authentication token response. The changes are clean, complete, and properly tested.

Changes Analyzed

1. BaseRequestValidator.cs (src/Identity/IdentityServer/RequestValidators/BaseRequestValidator.cs:810)

  • ✅ Removed customResponse.Add("ResetMasterPassword", string.IsNullOrWhiteSpace(user.MasterPassword));
  • This property indicated whether a user had a master password set
  • Now fully replaced by the UserDecryptionOptions property which provides more comprehensive decryption information

2. CustomTokenRequestValidator.cs (src/Identity/IdentityServer/RequestValidators/CustomTokenRequestValidator.cs:154-170)

  • ✅ Removed unused import: Bit.Core.Auth.Models.Api.Response
  • ✅ Removed KeyConnector backward compatibility code that set ResetMasterPassword to false
  • ✅ Cleaned up 17 lines of legacy code that was checking UserDecryptionOptions to set the deprecated property

3. IdentityServerTests.cs (test/Identity.IntegrationTest/Endpoints/IdentityServerTests.cs:65)

  • ✅ Removed test assertion for the deprecated property: AssertHelper.AssertJsonProperty(root, "ResetMasterPassword", JsonValueKind.False);

Security Analysis

👍 No security concerns identified

  • The ResetMasterPassword property was informational only (read-only in responses)
  • It has been replaced by the more comprehensive UserDecryptionOptions property
  • No sensitive data handling or encryption logic was modified
  • Zero-knowledge principles remain intact

Code Quality

Clean removal with proper cleanup

  • All references to ResetMasterPassword have been removed (verified with codebase search)
  • Removed unused import statement
  • Eliminated backward compatibility code for KeyConnector
  • Test coverage updated appropriately

Verification

Recommendations

None - This PR is ready to merge. The changes are:

  • Complete and thorough
  • Properly tested
  • Security-neutral
  • Well-documented in the PR description

Notes

📝 The removal of the backward compatibility code in CustomTokenRequestValidator is particularly good - it eliminates technical debt while maintaining functionality through the modern UserDecryptionOptions approach.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants