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][SecurityBundle] Show user account status errors#58300
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
80060ea
to71408c1
CompareFrom#56830 (review)
@nicolas-grekas unless we decide to revert a security fix we cannot avoid the option I think |
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.
We need an entry in both SecurityBundle and Security\Http's CHANGELOG files
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
return true; | ||
} | ||
if ($this->showAccountStatusExceptions) { |
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.
I would expectCustomAuthenticationMessageExceptions
to show up even ifshowAccountStatusExceptions
is false, as it's the case today withhideUserNotFoundExceptions
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.
Not sure how to deal with theCustomAuthenticationMessageExceptions
as this is no account specific exception (extendsAccountStatusException
), but a general authentication exception (extendsAuthenticationException
).
The new key is namedhide_account_status_exceptions
, so this might be confusing.
src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
wouterj commentedSep 18, 2024 • 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.
Maybe an unpopular opinion: I'm not sure if I would implement this feature in Symfony at all. This is part of code that was released with theuser enumeration CVE. With the new option set to true, you'll reintroduce the possibility of user enumeration based on error messages as you now get "Invalid credentials" (user does not exists) or "This account is locked" (account status error). The I'm not convinced we need to provide an extra option to achieve this (especially because we consider the new feature less secure). |
I agree, in theory you could use this to enumerate all users that have anaccount status error, butuser does not exist errors are still silenced with solution. But you may also enumerate users by the time it takes to generate the response at all, if you want to use all possible ways ;) The current solution looks broken to me. You either expose ALL user information or no user feedback at all. There is no way to inform the user, that it is currently not possible to login with the user. The current solution resulted in several service desk tickets that I need to check every time. What about creating a new enum config key with three different states like: |
Renaming/changing the existing option looks sensible to me as account status errors means that a user is actually found. |
c16c852
tob5b742d
CompareChanged the config key to |
6792899
to6347ad7
CompareAnything left to do@chalasr ? |
Sorry for the back and forths but I think there is confusion about my last comment:
I agree with Wouter this is not worth a dedicated option, but I do think it's worth renaming the existing |
So you're fine with deprecating the existing And if you are using the new |
Yes. The new option should win over the to-be-deprecated one when it's explicitly set (to not change the behavior of apps explicitly setting the old option to false). The new option should default to @wouterj are you ok with the proposed plan? |
wouterj commentedOct 25, 2024 • 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.
Ok, let's go with an enum option with these conditions (maybe worth calling the middle one I guess the easiest BC way would be removing the default value from the current option adding adding the new option with an |
Sounds good 👍 |
6347ad7
toac57b42
Comparesrc/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.
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/SecurityExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/Authentication/AuthenticatorManager.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
5222ad3
to6baf154
CompareThanks for the review@stof :) Applied your suggestions and the build is passing |
6baf154
tof9b8d7e
Compare@core23 Can you please update the UPGRADE-7.3 file about the deprecated option? And add a line about that deprecation in the already updated CHANGELOG file also? |
f9b8d7e
to011efe1
CompareDone :) |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
011efe1
toa565f64
Comparecore23 commentedJan 30, 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.
Any chance to get this merge soon-ish?@chalasr |
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.
Can you please rebase?
a565f64
to7538e44
CompareDone. The failing tests look unrelated to the changes |
7538e44
to5a11de5
CompareThank you@core23. |
a7a32f7
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
According to the
hideUserNotFoundExceptions
flag, onlyUserNotFoundException
should be hidden, but the implementation was also silencing account specific errors.To fix the issue in a BC way, a new
hide_account_status_exceptions
config key was introduced to show account exceptions.This key should be changed tofalse with an upcoming version (7.3 or 7.4?), so that the existing
hide_user_not_found
config key works as intended with the upcoming symfony 8 release.