-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Fixed #13336 - Save unhashed password if no password provided #13343
Fixed #13336 - Save unhashed password if no password provided #13343
Conversation
Signed-off-by: snipe <[email protected]>
PR Summary
|
We probably also have to add a bit in the settings where we batch update any user with |
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.
Some minor changes but overall 👍🏾
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
Signed-off-by: snipe <[email protected]>
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 to me - if you take Marcus's comment into consideration and fix that one part.
But I had another idea that might be good -
What if we change the ->noPassword()
method to look like this:
function noPassword()
{
$this->password = "*** NO PASSWORD ***";
}
Then you could make all the places where you're calling this method a little bit simpler -
Instead of $this->password = $this->noPassword()
you could just say $this->noPassword()
.
This is not a hill I'm going to die on, however. Just an idea.
@uberbrady I think that's definitely worth looking at for a refactor. I'd like to push this out as-is right now though - thank you! |
This addresses issue #13336, where if LDAP sync is enabled, and then disabled, the LDAP password remains for users that logged in while LDAP sync was enabled.
By setting passwords to a static string that isn't hashed, the user will never be able to login, since we the process of logging in compares only hashes, and the string
*** NO PASSWORD ***
will never ever match a submitted hashed password.We have to be careful here to make sure we do not ever hash that NO PASSWORD string, of course.
This has the added benefit of making importing a large number of LDAP users go faster, since bcrypt does slow things down a bit.