-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[PM-30370] Add salt to vault sync response #7248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0240c94
a323d75
da8687b
e8ed005
1d4e402
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ public SyncResponseModel( | |
| Parallelism = user.KdfParallelism | ||
| }, | ||
| MasterKeyEncryptedUserKey = user.Key!, | ||
| Salt = user.Email.ToLowerInvariant() | ||
| Salt = user.GetMasterPasswordSalt() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π¨ CRITICAL β Suggested fix in public string GetMasterPasswordSalt()
{
return MasterPasswordSalt ?? Email.ToLowerInvariant().Trim();
} |
||
| } | ||
| : null, | ||
| WebAuthnPrfOptions = webAuthnPrfOptions.Length > 0 ? webAuthnPrfOptions : null, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β CRITICAL:
GetMasterPasswordSalt()never readsUser.MasterPasswordSalt-- it always returnsEmail.ToLowerInvariant().Trim(), so the new explicit-salt tests will fail and the feature does not work.Details and fix
Commit
0240c94admessage says "add null coalesce to GetMasterPasswordSalt" but the method body insrc/Core/Entities/User.csline 117-120 was never updated:It should be:
Without this change, both
Get_HaveExplicitMasterPasswordSalt_SaltReturnedInSyncandConstructor_UserWithExplicitSalt_UsesMasterPasswordSaltwill fail because they setMasterPasswordSalt = "explicit-salt-value"but the method ignores it and returns the email.