Skip to content

[PM- 21926] Add MasterPasswordSalt to DTOs#7178

Draft
ike-kottlowski wants to merge 8 commits intomainfrom
auth/pm-21926/add-salt-to-dtos
Draft

[PM- 21926] Add MasterPasswordSalt to DTOs#7178
ike-kottlowski wants to merge 8 commits intomainfrom
auth/pm-21926/add-salt-to-dtos

Conversation

@ike-kottlowski
Copy link
Contributor

@ike-kottlowski ike-kottlowski commented Mar 9, 2026

🎟️ Tracking

PM-21926
PM-32389
PM-28827
PM-30370

📔 Objective

PM-21926

We need to begin to return the MasterPasswordSalt column in queries that will expect it in the future. This PR adds the MasterPasswordSalt to the ReadKdfByEmail method in the User Repository and adds the MasterPasswordSalt to the OrganizationUserResetPasswordDetails method.

PM-32289

We add null coalescing to the User.GetMasterPasswordSalt() method to be the only fallback when a MasterPasswordSalt is null. The locations that set the Salt to the User.Email.Lower().Trim() were replaced with the User.GetMasterPasswordSalt() method to ensure forward compatibility.

PM-28827

Accept the MasterPasswordUnlockData?.Salt from the RegisterFinishRequestModel. This does not do any coalescing to match the pattern where the Server only writes what the Client submits and does not try to guess.

PM-30370

Return User.MasterPasswordSalt() in the UserDecryptionResponseModel and the SyncResponseModel instead of the User.Email.ToLower().Trim().

📸 Screenshots

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Logo
Checkmarx One – Scan Summary & Details748587df-f31d-4fa7-a7e3-59b979d7373a


Fixed Issues (118) Great job! The following issues were fixed in this Pull Request
Severity Issue Source File / Package
CRITICAL Stored_XSS /src/SharedWeb/Health/HealthCheckServiceExtensions.cs: 61
CRITICAL Stored_XSS /util/Server/Startup.cs: 57
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1527
MEDIUM CSRF /src/Api/Tools/Controllers/SendsController.cs: 73
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 307
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 307
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs: 122
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 217
MEDIUM CSRF /src/Api/Public/Controllers/CollectionsController.cs: 91
MEDIUM CSRF /src/Api/Public/Controllers/CollectionsController.cs: 91
MEDIUM CSRF /src/Api/Public/Controllers/CollectionsController.cs: 91
MEDIUM CSRF /src/Api/Public/Controllers/CollectionsController.cs: 91
MEDIUM CSRF /src/Api/Controllers/CollectionsController.cs: 176
MEDIUM CSRF /src/Api/Controllers/CollectionsController.cs: 176
MEDIUM CSRF /src/Api/Controllers/CollectionsController.cs: 176
MEDIUM CSRF /src/Api/Controllers/CollectionsController.cs: 176
MEDIUM CSRF /src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs: 146
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 452
MEDIUM CSRF /src/Api/Dirt/Controllers/OrganizationReportsController.cs: 189
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 531
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs: 81
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs: 107
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/Dirt/Controllers/OrganizationReportsController.cs: 233
MEDIUM CSRF /src/Api/Dirt/Controllers/OrganizationReportsController.cs: 286
MEDIUM CSRF /src/Api/Dirt/Controllers/OrganizationReportsController.cs: 189
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 289
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1403
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1178
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1062
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1311
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 399
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 390
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 390
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs: 95
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs: 82
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs: 70
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/OrganizationBillingVNextController.cs: 49
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/ProviderBillingVNextController.cs: 40
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1256
MEDIUM CSRF /src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs: 146
MEDIUM CSRF /src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs: 105
MEDIUM CSRF /src/Api/Vault/Controllers/SecurityTaskController.cs: 66
MEDIUM CSRF /src/Api/KeyManagement/Controllers/AccountsKeyManagementController.cs: 105
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 721
MEDIUM CSRF /src/Api/Auth/Controllers/EmergencyAccessController.cs: 173
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 192
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 641
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 412
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 385
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 664
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 126
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/NotificationCenter/Controllers/NotificationsController.cs: 67
MEDIUM CSRF /src/Api/NotificationCenter/Controllers/NotificationsController.cs: 61
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 138
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 166
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 166
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 419
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 419
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 558
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/MembersController.cs: 181
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/MembersController.cs: 181
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 161
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 709
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 136
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 216
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 87
MEDIUM CSRF /src/Api/Controllers/CollectionsController.cs: 208
MEDIUM CSRF /bitwarden_license/src/Scim/Controllers/v2/GroupsController.cs: 97
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1050
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1160
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 293
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 191
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1403
MEDIUM CSRF /src/Api/AdminConsole/Controllers/ProviderUsersController.cs: 183
MEDIUM CSRF /src/Api/AdminConsole/Controllers/ProviderUsersController.cs: 202
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 293
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1508
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/MembersController.cs: 218
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 582
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/GroupsController.cs: 164
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 709
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 245
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1088
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1017
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 732
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 732
MEDIUM CSRF /src/Api/Auth/Controllers/WebAuthnController.cs: 159
MEDIUM SSL_Verification_Bypass /src/Core/Platform/Mail/Delivery/MailKitSmtpMailDeliveryService.cs: 84
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 171
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 170
MEDIUM Use_Of_Hardcoded_Password /util/Seeder/Factories/UserSeeder.cs: 12
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 166
MEDIUM Use_Of_Hardcoded_Password /src/Identity/IdentityServer/RequestValidators/SendAccess/SendAccessConstants.cs: 111
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 201
MEDIUM Use_Of_Hardcoded_Password /src/Identity/IdentityServer/RequestValidators/SendAccess/SendAccessConstants.cs: 62
MEDIUM Use_Of_Hardcoded_Password /src/Identity/IdentityServer/RequestValidators/SendAccess/SendAccessConstants.cs: 58
MEDIUM Use_Of_Hardcoded_Password /src/Identity/IdentityServer/RequestValidators/SendAccess/SendAccessConstants.cs: 26
MEDIUM Use_Of_Hardcoded_Password /src/Identity/IdentityServer/RequestValidators/DeviceValidator.cs: 43
MEDIUM Use_Of_Hardcoded_Password /src/Core/KeyManagement/Sends/SendPasswordHasherServiceCollectionExtensions.cs: 14
MEDIUM Use_Of_Hardcoded_Password /src/Core/Constants.cs: 242

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 14.00%. Comparing base (8d9ace6) to head (d2805cb).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...Api/Request/Accounts/RegisterFinishRequestModel.cs 0.00% 1 Missing ⚠️
src/Core/Entities/User.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7178       +/-   ##
===========================================
- Coverage   56.88%   14.00%   -42.88%     
===========================================
  Files        2028     1241      -787     
  Lines       88826    52916    -35910     
  Branches     7918     4091     -3827     
===========================================
- Hits        50528     7412    -43116     
- Misses      36468    45372     +8904     
+ Partials     1830      132     -1698     

☔ 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.

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.

1 participant