-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Check UserInterface::getPassword is not null before calling needsRehash #34802
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
[Security] Check UserInterface::getPassword is not null before calling needsRehash #34802
Conversation
src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
Outdated
Show resolved
Hide resolved
@xabbuh Based on #34824 (comment) I could make some additional changes in this PR if you agree. Which option would have your preference?
|
@dbrekelmans I think |
By the way, #34779 has been merged up to 4.4. You can rebase your changes now. :) |
@xabbuh I rebased on 4.4. I think the PR is good to go :) |
src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Encoder/UserPasswordEncoder.php
Outdated
Show resolved
Hide resolved
Thank you @dbrekelmans. |
…fore calling needsRehash (dbrekelmans) This PR was squashed before being merged into the 4.4 branch (closes #34802). Discussion ---------- [Security] Check UserInterface::getPassword is not null before calling needsRehash | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface::needsRehash()` expects a string as the input argument. In some cases `Symfony\Component\Security\Core\User\UserInterface::getPassword()` is used as the input argument, but this function can return `null` resulting in a potential type error. Commits ------- 8e4cf49 [Security] Check UserInterface::getPassword is not null before calling needsRehash
And congratz for your first contrib! |
Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface::needsRehash()
expects a string as the input argument. In some casesSymfony\Component\Security\Core\User\UserInterface::getPassword()
is used as the input argument, but this function can returnnull
resulting in a potential type error.