-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security][Http][SwitchUserListener] Ignore all non existent username protection errors #36223
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][Http][SwitchUserListener] Ignore all non existent username protection errors #36223
Conversation
The driver/authenticator should be updated instead to me - it should throw an AuthenticationException |
ca680e1
to
3843cde
Compare
src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
Outdated
Show resolved
Hide resolved
3843cde
to
a874f45
Compare
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.
(once fabbot's report is fixed) <= false positive
This does not feel right. |
Should we narrow to some specific error codes then? |
That's indeed a good point. What about moving the |
That's what I did in the first place, until Nicolas' comment. |
I confirm: the issue is in the Doctrine bridge, not in the |
Hmm, I would prefer to change this inner symfony/src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php Lines 156 to 167 in e0de6cc
Putting this in the The first |
OK, good argument! Let's revert to your initial proposal then @fancyweb, and sorry for the confusion :) |
… protection errors
a874f45
to
42311d5
Compare
I reverted to the initial change (on 4.4). Sorry for the massive ping 😅 |
Thank you @fancyweb. |
Since we generate the non existent username blindly, it can lead to Doctrine exceptions or any other exception.
We can catch all exceptions here but I guess it reduces the protection since the SQL query was not executed?
Alternative: we can only catch Doctrine DriverException (in addition to the existing AuthenticationException) and only silent the reported error codes?