File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/Symfony/Component/Security/Http/Firewall Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ PR11 to PR12
26
26
<app:engine>twig</app:engine>
27
27
<twig:extension>twig.extension.debug</twig:extension>
28
28
29
+ * Fixes a critical security issue which allowed all users to switch to
30
+ arbitrary accounts when the SwitchUserListener was activated. Configurations
31
+ which do not use the SwitchUserListener are not affected.
32
+
29
33
PR10 to PR11
30
34
------------
31
35
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Security \Http \Firewall ;
13
13
14
+ use Symfony \Component \Security \Core \Exception \AccessDeniedException ;
14
15
use Symfony \Component \Security \Core \SecurityContextInterface ;
15
16
use Symfony \Component \Security \Core \User \UserProviderInterface ;
16
17
use Symfony \Component \Security \Core \User \UserCheckerInterface ;
@@ -112,7 +113,9 @@ private function attemptSwitchUser(Request $request)
112
113
throw new \LogicException (sprintf ('You are already switched to "%s" user. ' , $ token ->getUsername ()));
113
114
}
114
115
115
- $ this ->accessDecisionManager ->decide ($ token , array ($ this ->role ));
116
+ if (false === $ this ->accessDecisionManager ->decide ($ token , array ($ this ->role ))) {
117
+ throw new AccessDeniedException ();
118
+ }
116
119
117
120
$ username = $ request ->get ($ this ->usernameParameter );
118
121
You can’t perform that action at this time.
0 commit comments