-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Fix UserNotFoundException is not thrown #45452
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
Conversation
Hey! I think @IonBazan has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
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 to target 5.4, and add a test case?
@@ -66,6 +67,13 @@ public function getUser(): UserInterface | |||
} | |||
|
|||
$user = ($this->userLoader)($this->userIdentifier); | |||
|
|||
// No user has been found via the $this->userLoader callback. | |||
if (is_null($user)) { |
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.
if (null === $user) {
Can you please add a test case, and rebase + target 5.4 also? |
don't have time to thoroughly check the pr and how does the |
@wouterj Can you have a look at this PR? |
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.
With the suggested CS changes, this change looks good to me (for 5.4+).
This code is within the user enumeration control of the authenticator manager - so nothing to worry about concerning that.
if (is_null($user)) { | ||
($exception = new UserNotFoundException())->setUserIdentifier($this->userIdentifier); | ||
throw $exception; |
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.
if (is_null($user)) { | |
($exception = new UserNotFoundException())->setUserIdentifier($this->userIdentifier); | |
throw $exception; | |
if (null === $user) { | |
$exception = new UserNotFoundException(); | |
$exception->setUserIdentifier($this->userIdentifier); | |
throw $exception; |
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 CS issues have been adressed
Thank you @damienfa. |
Hello @fabpot , |
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Fix UserNotFoundException is not thrown | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #45070 | License | MIT | Doc PR | N/A Commits ------- 7e0ed85 Fix issue 45070 : UserNotFoundException is not thrown
* 5.4: cs fix bug #45452 [Security] Fix UserNotFoundException is not thrown (damienfa)
* 6.0: cs fix bug #45452 [Security] Fix UserNotFoundException is not thrown (damienfa)
See #46063 for the missing test case |
This PR was merged into the 5.4 branch. Discussion ---------- [Security] Add test case for user not found | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Covering the changes made in #45452. Commits ------- 4a75e98 [Security] Add test case for user not found
Uh oh!
There was an error while loading. Please reload this page.