Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Security] Exclude remember_me from default login authenticators#60266
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I think (though I could be wrong) that the test failures are due to flaky tests. |
Uh oh!
There was an error while loading.Please reload this page.
chalasr commentedApr 27, 2025 • 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.
Thanks for the PR. As said in the linked issue, I'm rather 👎 on this as the proposed |
Thanks for your feedback@chalasr , and you're right, I should have consulted you before proceeding with the implementation. I understand your concerns about approach Do you think there's a different approach that might still address the underlying need, or would it make more sense to close this pull request? |
If you agree to work on the suggested alternative which is to patch the |
Yeah, I'm fine with that alternative, so I'll go ahead and make the change next weekend. |
ed18bb4
to9d20d21
Comparesantysisi commentedApr 29, 2025 • 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.
Hi@chalasr! 👋 I've updated the branch with the patch to the login() method. Since this is a patch to the login behavior, I changed the base branch from 7.3 to 6.4, and also updated the title and description of the PR to reflect the changes. If there's anything else I need to address, please let me know! Thanks ❤️ Edit: I was also thinking about adding a new conditionhere to check if the passed authenticatorName is remember_me. If so, it could trigger a deprecation notice in 7.4, and throw an error in version 8.0. What do you think about that approach? For Symfony 7.4: if (in_array($authenticatorName,self::SECURITY_LOGIN_EXCLUSIONS)) {trigger_deprecation('symfony/security-bundle','7.4','The "%s" authenticator is not allowed to be used with the "%s" method. Use a different authenticator.',$authenticatorName,__METHOD__));} For Symfony 8.0: if (in_array($authenticatorName,self::SECURITY_LOGIN_EXCLUSIONS)) {thrownewLogicException(sprintf('The "%s" authenticator is not allowed to be used with the "%s" method. Use a different authenticator.',$authenticatorName,__METHOD__));} |
2248bb8
to4f93320
CompareWould it be an option to always pick the first authenticator from the retrieved list of authenticators and not just when there is only one authenticator configured? (Basically remove these lineshttps://github.com/symfony/symfony/blob/7.3/src/Symfony/Bundle/SecurityBundle/Security.php#L179-L181) |
Required explicitness is desired in this domain IMHO, better get a good error message than a security hole. |
Uh oh!
There was an error while loading.Please reload this page.
I get your point but I don't think it is worth it right now, we can rethink about it the day it happens |
4f93320
tofabc0e3
Comparefabc0e3
to6ea76ca
Compare
chalasr left a comment• 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.
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.
Authenticating through theremember_me
authenticator was never meant to work at it's a very special one. 👍 to remove the ambiguity as a bugfix
Thank you@santysisi. |
e417f12
intosymfony:6.4Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
🐛 Bugfix Description:
This fix addresses an issue where the remember_me authenticator was incorrectly included in the list of authenticators used during the security login process. When only one authenticator was configured and it was remember_me, the login flow could break or behave unexpectedly, as remember_me is not intended to be used as a primary authenticator. The login() method has been updated to exclude remember_me from the list, ensuring proper handling of login attempts and avoiding unintended authentication behavior.