-
Notifications
You must be signed in to change notification settings - Fork 698
v23: allow admin password to be stored in config.php without hashing … #2222
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
v23: allow admin password to be stored in config.php without hashing … #2222
Conversation
tvdijen
left a comment
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.
This looks good @monkeyiq !
I would like to add a deprecation warning to the logs when the password is plain-text, and the upgrade notes need a touch up.
|
Would it be better to use |
|
I was thinking about using something like |
|
The deprecation warning is a great idea. It is much better to continue to work and offer a suggestion to improve security and at some stage remove the old acceptance of plain password from config.php. |
|
I think I'll make the deprecation warning and upgrade notes PR separate linking back to this. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## simplesamlphp-2.3 #2222 +/- ##
=======================================================
- Coverage 44.92% 44.92% -0.01%
- Complexity 3892 3893 +1
=======================================================
Files 162 162
Lines 12972 12974 +2
=======================================================
Hits 5828 5828
- Misses 7144 7146 +2 |
|
I was about the cherry pick this forward to master but I am not sure we want it that far out? |
|
I picked it into 2.4 |
|
No, master is where we break stuff and force hashed passwords! |
|
sounds good! |
|
ok, I'll take a look at another PR for deprecation warning and release notes update. |
Given that this touches the admin login route directly, some more eyes to review are appreciated.
The code uses the result of
password_get_infoand if thealgois null then we know theauth.adminpasswordfrom config.php is not set to a hashed password. At that stage the new lines do a direct string compare in the same way thatpwValiddoes in 2.2 and used to in 2.3. More explicitly:simplesamlphp/src/SimpleSAML/Utils/Crypto.php
Line 379 in a9dc957
This is the intent of the code. Admins can again put plaintext passwords in config.php for auth.adminpassword if desired. Hashing is recommended but not required any more and functionality returns to that of v2.2.
We can see a null for the password for example in the following test
This was requested here #2216 (comment)
More information about the changes around the admin password hashing and how we got where we are in 2.3 is at #2212 (comment)