-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[security] Error when calling needsRehash() with null password #34824
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
Comments
Can you confirm that #34802 will fix this? |
No it doesn't... In Here's the Stack Trace
|
Oh, there was also #34779. Does that help? |
No Doesn't help. The problem occures because of the signature of the methode Either the signature is change to |
I fail to see how this could happen when both PRs are merged. We will then cover all the cases where the password is |
The call to
|
Got it, #34802 should throw before calling |
Sorry but PR #34802 doesn't solves the problem. |
From your stack trace the call happens at symfony/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php Lines 58 to 66 in 6e44447
|
Oh, sorry, I missed a PR... |
Symfony version(s) affected: 4.4.1
Description
Using the
form_login
authentification provider with a database user provider, got an error when login with a user with a null password (in the entity/database) :Argument 1 passed to Symfony\Component\Security\Core\Encoder\NativePasswordEncoder::needsRehash() must be of the type string, null given, called in ...\vendor\symfony\security-core\Encoder\MigratingPasswordEncoder.php on line 51
This works in Symfony 4.1.
How to reproduce
Create an application with
Possible Solution
Make parameter
$encoded
nullable inSymfony\Component\Security\Core\Encoder\NativePasswordEncoder::needsRehash()
Additional context
In my case I have null password because some users are authenticate with the
form_login
(password is in the User entity) others are authenticate withform_login_ldap
(in this case the password is null in the User entity).The text was updated successfully, but these errors were encountered: