Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Security] Show user account specific errors#56830

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

Closed

Conversation

core23
Copy link
Contributor

@core23core23 commentedMay 20, 2024
edited by nicolas-grekas
Loading

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#50028
LicenseMIT

According to thehideUserNotFoundExceptions flag, onlyUserNotFoundException should be hidden, but the implementation was also silencing account specific errors.

To fix the issue in a BC way, a newshow_account_status_exceptions config key was introduced to show account exceptions.

@core23core23 requested a review fromchalasr as acode ownerMay 20, 2024 19:37
@carsonbotcarsonbot added this to the5.4 milestoneMay 20, 2024
@core23core23force-pushed thefix-auth-exception-handling branch 2 times, most recently fromf32956f to32d8da7CompareMay 20, 2024 19:50
@core23
Copy link
ContributorAuthor

Looks like fabbot.io is showing a falsepositive code style issue. When applying the (unrelated) changes, the tests are failing

@chalasr
Copy link
Member

Hi Christian,

The fact that whether built-inAccountStatusException are caught or not depends on thehide_user_not_found flag although they are notUserNotFoundException might sound weird, yet it is on purpose.
We did this as part ofa security fix 3 years ago. Reasoning was that the use case such exceptions serve is pretty much the same asUserNotFoundException ones regarding user enumeration.

So if we want to change this, that would definitely be a new feature.
Also it should not be about suddenly stopping to catch those, first because that would be too much of a BC break and also because it would go against the decision that led to the CVE mentioned above. What could be done is to rename the flag for the sake of clarity or split it in two. Given the traction on related issues, I would be fine doing so.

@antfarmer
Copy link

I'm not clear; is this fix now to revert the changes to only mask UserNotFoundException's?

Personally, I'm fine with that because I do not see much benefit to masking locked accounts. The account would be locked and there would normally be nothing a legitimate or malicious user could do to unlock the account. Only to accommodate others on this, it may be worth considering having two settings, eg. hideUserNotFoundExceptions and hideAllAuthExceptions.

In my project I see there are at least 3 places where this logic is implemented:

  • security-http: Symfony\Component\Security\Http\Authentication\AuthenticatorManager: handleAuthenticationFailure
  • security-core: Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider: authenticate
  • security-guard: Symfony\Component\Security\Guard\Firewall\GuardAuthenticationListener: executeGuardAuthenticator

Will these also be updated or are these others being phased out? Also, I assume this will be patched in 5.4+ going forward.

@carsonbotcarsonbot changed the titleShow user account specify errors[Security] Show user account specify errorsMay 22, 2024
@nicolas-grekas
Copy link
Member

How can we move on with this PR?

@core23core23force-pushed thefix-auth-exception-handling branch from32d8da7 to26852b9CompareAugust 29, 2024 06:34
@OskarStarkOskarStark changed the title[Security] Show user account specify errors[Security] Show user account specific errorsAug 29, 2024
@core23core23force-pushed thefix-auth-exception-handling branch 2 times, most recently from44b6ad7 to181ff20CompareAugust 30, 2024 06:39
@core23core23force-pushed thefix-auth-exception-handling branch from181ff20 to33663d3CompareAugust 30, 2024 06:42
@core23
Copy link
ContributorAuthor

I updated the PR, so it should be BC now.

@nicolas-grekasnicolas-grekas modified the milestones:5.4,7.2Sep 17, 2024
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This should target 7.2 as this is a new feature.
@chalasr can you please have another look?
I don't like adding new options so if there's a way without, suggestions welcome :)

@@ -131,4 +134,17 @@ abstract protected function retrieveUser(string $username, UsernamePasswordToken
* @throws AuthenticationException if the credentials could not be validated
*/
abstract protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token);

private function isFilteredException(Exception $exception): bool

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

can't we be more specific about the type-hint? (same below)

@core23
Copy link
ContributorAuthor

Closing in favor of#58300

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.2
Development

Successfully merging this pull request may close these issues.

6 participants
@core23@chalasr@antfarmer@nicolas-grekas@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp