-
Notifications
You must be signed in to change notification settings - Fork 16
IBX-10124: Add support for Argon2 password hashes #581
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
Open
glye
wants to merge
28
commits into
main
Choose a base branch
from
ibx10124_argon2_password_hashes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
5 tasks
29547bd
to
5319d16
Compare
7f82ac9
to
683231f
Compare
f38f8ac
to
c3a42ad
Compare
@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 0cc17bf.
Co-authored-by: Konrad Oboza <[email protected]>
Co-authored-by: Konrad Oboza <[email protected]>
Co-authored-by: Konrad Oboza <[email protected]>
This reverts commit 2d86b6f.
Co-authored-by: Adam Wójs <[email protected]>
2f60dd3
to
a258078
Compare
Rebased on main, fixed merge conflict in userservice. |
|
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