IBX-10124: Add support for Argon2 password hashes #581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related PRs:
Description:
Add support for PASSWORD_ARGON2I and PASSWORD_ARGON2ID password hashes, which increase security over the standard bcrypt.
Tested manually by passing hash type PASSWORD_ARGON2ID to the PasswordHashService:
Newly created users get the new hash type, and login works fine. For existing users with the standard hashtype 7 (bcrypt), this doesn't update the password hash on either login or when changing the password. It seems the code for this was removed when we removed MD5 support way back in the day.
UserService::updateUserPassword()
always goes with the current hashtype the user has.If I change the code to always use the default hash type, it seamlessly updates the hash type when changing the password. But this may not be what we want. It would be a BC break in the sense that the new hashes won't work in the older DXP, or custom code based on the older DXP. However, if you want to keep BC, why change the default hash type in the first place?
We could set the preferred hash type in config. Or we could potentially set the hash type in the User FT, to make it zero config.
TODO / followup
Read more
Documentation:
Docs that need an update:
https://doc.ibexa.co/en/latest/content_management/field_types/field_type_reference/userfield/#available-password-hash-types
https://doc.ibexa.co/en/latest/infrastructure_and_maintenance/security/security_checklist/#use-secure-password-hashing