Skip to content

Commit 32e1be8

Browse files
committed
bug #34551 [Security] SwitchUser is broken when the User Provider always returns a valid user (tucksaun)
This PR was merged into the 4.3 branch. Discussion ---------- [Security] SwitchUser is broken when the User Provider always returns a valid user | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Since bcfc282, if a UserProvider always returns a valid User object (which can happen in some OAuth workflow), switching user is not possible anymore as we hit the `LogicException`. This patch should be safe as the timing-attack prevention is kept. Commits ------- 2bf6cd2 [Security] Fix SwitchUser is broken when the User Provider always returns a valid user
2 parents 2743e25 + 2bf6cd2 commit 32e1be8

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ private function attemptSwitchUser(Request $request, $username)
153153

154154
try {
155155
$this->provider->loadUserByUsername($nonExistentUsername);
156-
throw new \LogicException('AuthenticationException expected');
157156
} catch (AuthenticationException $e) {
158157
}
159158
} catch (AuthenticationException $e) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy