Skip to content

Commit 971ff37

Browse files
security #cve-2021-32693 [SecurityHttp] Fix "Authentication granted with multiple firewalls" (wouterj)
This PR was merged into the 5.3 branch.
2 parents ed4aed2 + c4ec20d commit 971ff37

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

Tests/Functional/AuthenticatorTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,17 @@ public function provideEmailsWithFirewalls()
8787
yield ['[email protected]', 'main'];
8888
yield ['[email protected]', 'custom'];
8989
}
90+
91+
public function testMultipleFirewalls()
92+
{
93+
$client = $this->createClient(['test_case' => 'Authenticator', 'root_config' => 'multiple_firewalls.yml']);
94+
95+
$client->request('POST', '/firewall1/login', [
96+
'_username' => '[email protected]',
97+
'_password' => 'test',
98+
]);
99+
100+
$client->request('GET', '/firewall2/profile');
101+
$this->assertResponseRedirects('http://localhost/login');
102+
}
90103
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
imports:
2+
- { resource: ./config.yml }
3+
- { resource: ./security.yml }
4+
5+
security:
6+
enable_authenticator_manager: true
7+
firewalls:
8+
firewall1:
9+
pattern: /firewall1
10+
provider: in_memory
11+
form_login:
12+
check_path: /firewall1/login
13+
firewall2:
14+
pattern: /firewall2
15+
provider: in_memory2
16+
form_login:
17+
check_path: /firewall2/login

Tests/Functional/app/Authenticator/routing.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ security_main_profile:
1818
security_custom_profile:
1919
path: /custom/user_profile
2020
defaults: { _controller: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle\SecurityController::profileAction }
21+
22+
firewall1_login:
23+
path: /firewall1/login
24+
25+
firewall2_profile:
26+
path: /firewall2/profile
27+
defaults:
28+
_controller: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle\ProfileController

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"symfony/security-core": "^5.3",
3030
"symfony/security-csrf": "^4.4|^5.0",
3131
"symfony/security-guard": "^5.3",
32-
"symfony/security-http": "^5.3"
32+
"symfony/security-http": "^5.3.2"
3333
},
3434
"require-dev": {
3535
"doctrine/annotations": "^1.10.4",

0 commit comments

Comments
 (0)