IBX-10124: Add support for Argon2 password hashes#581
Open
Conversation
5 tasks
29547bd to
5319d16
Compare
7f82ac9 to
683231f
Compare
f38f8ac to
c3a42ad
Compare
Contributor
Author
|
@konradoboza How do you think it looks now? I removed the on-login code, and fixed other test failures that came up. |
This reverts commit 0cc17bf77f8b4d64eb52ca2055e206735b2083d6.
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
This reverts commit 2d86b6fce31f8b5cd4e838664151bbcb25dbb22c.
Co-authored-by: Adam Wójs <adam@wojs.pl>
a258078 to
fca04e0
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 hash types, which increase security over the standard bcrypt. Long enough bcrypt hashes are still considered secure, but there are some recommendations to upgrade to Argon2.
Before this PR,
UserService::updateUserPassword()always goes with the current hashtype the user has. It seems that the code we had for updating hash type from md5 to bcrypt long ago was removed when we removed md5 support.PR goals
2) for whether existing users should be upgraded to the default hash type on login.If configured (default: no) the hash type will be changed when the user logs in, and changes in PHP's default hash options will take effect.Manual tests
Enabled by adding this config to ibexa.yaml
ibexa:system:default:in v5.0.0:Convenient query for verifying that hash types are updated:
select login, password_hash_type, substring(password_hash,1,62), from_unixtime(password_updated_at) as updated_at from ibexa_user;Logging in: Works, hash type is upgraded when enabledThe current test failures hint at a deeper problem with prioritizing Ibexa's CheckPassportEvent subscriber before the Symfony one. This is however required in order to upgrade the password hash on login, because the Symfony subscriber "eats" the password.Performance
Upgrade on login adds a db write to login when the upgrade happens (once per user), but after that there are no extra db calls, just the password_needs_rehash() call.Followup, not needed in this PR:
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