Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[SecurityBundle] Passwords are not encoded when algorithm set to "true"#34738
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[SecurityBundle] Passwords are not encoded when algorithm set to "true"#34738
Uh oh!
There was an error while loading.Please reload this page.
Conversation
derrabus commentedDec 1, 2019
Can we catch this earlier? imho, |
nieuwenhuisen commentedDec 2, 2019
Sounds reasonable. I will take a look at the config validation. |
c2926d9 tocdb0b49Comparenieuwenhuisen commentedDec 2, 2019
I have reset my previous updates and change the configuration validation. |
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
851ffb9 tod00464fCompared00464f tocb429cdCompare5d593d5 to83a5517Comparechalasr commentedDec 3, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Rebased on 3.4 since it applies there. Congratz for your first contrib! |
chalasr commentedDec 3, 2019
Thank you@nieuwenhuisen. |
…set to "true" (nieuwenhuisen)This PR was merged into the 3.4 branch.Discussion----------[SecurityBundle] Passwords are not encoded when algorithm set to "true"| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#34725| License | MIT| Doc PR | -If the algorithm is set to `true`, password will be encode as plain password.```security: encoders: App\User\User: algorithm: true```The reason for this is the not strict comparison of php switches.```switch ($config['algorithm']) { case 'plaintext':}````true == 'plaintext'` is `true`, so the first case is hit. My first solution was to cast the algorithm to a string, to prevent this. After some feedback I have catch this problem earlier and does not allow true as valid value to the algorithm option.Ps. This is my first PR for Symfony, any feedback is welcome :-)!Commits-------83a5517 [SecurityBundle] Passwords are not encoded when algorithm set to \"true\"
mhujer commentedDec 3, 2019
@nieuwenhuisen Thanks for fixing it! 👍 |
Uh oh!
There was an error while loading.Please reload this page.
If the algorithm is set to
true, password will be encode as plain password.The reason for this is the not strict comparison of php switches.
true == 'plaintext'istrue, so the first case is hit. My first solution was to cast the algorithm to a string, to prevent this. After some feedback I have catch this problem earlier and does not allow true as valid value to the algorithm option.Ps. This is my first PR for Symfony, any feedback is welcome :-)!