Skip to content

Commit 647d192

Browse files
Merge branch '5.2' into 5.x
* 5.2: [CI][Psalm] Install stable/released PHPUnit [Security] Add missing Finnish translations [Security][Guard] Prevent user enumeration via response content
2 parents 1336b3e + dbb5559 commit 647d192

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ private function createFirewall(ContainerBuilder $container, string $id, array $
502502
->replaceArgument(0, $authenticators)
503503
->replaceArgument(2, new Reference($firewallEventDispatcherId))
504504
->replaceArgument(3, $id)
505-
->replaceArgument(6, $firewall['required_badges'] ?? [])
505+
->replaceArgument(7, $firewall['required_badges'] ?? [])
506506
->addTag('monolog.logger', ['channel' => 'security'])
507507
;
508508

Resources/config/guard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
abstract_arg('Provider-shared Key'),
4646
abstract_arg('Authenticators'),
4747
service('logger')->nullOnInvalid(),
48+
param('security.authentication.hide_user_not_found'),
4849
])
4950
->tag('monolog.logger', ['channel' => 'security'])
5051
;

Resources/config/security_authenticator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
abstract_arg('provider key'),
4545
service('logger')->nullOnInvalid(),
4646
param('security.authentication.manager.erase_credentials'),
47+
param('security.authentication.hide_user_not_found'),
4748
abstract_arg('required badges'),
4849
])
4950
->tag('monolog.logger', ['channel' => 'security'])

Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testAuthenticatorManager()
4343
$this->assertEquals(AuthenticatorManager::class, $authenticatorManager->getClass());
4444

4545
// required badges
46-
$this->assertEquals([CsrfTokenBadge::class, RememberMeBadge::class], $authenticatorManager->getArgument(6));
46+
$this->assertEquals([CsrfTokenBadge::class, RememberMeBadge::class], $authenticatorManager->getArgument(7));
4747

4848
// login link
4949
$expiredStorage = $container->getDefinition($expiredStorageId = 'security.authenticator.expired_login_link_storage.main');

Tests/Functional/AuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testFirewallUserProvider($email, $withinFirewall)
4040
if ($withinFirewall) {
4141
$this->assertJsonStringEqualsJsonString('{"email":"'.$email.'"}', $client->getResponse()->getContent());
4242
} else {
43-
$this->assertJsonStringEqualsJsonString('{"error":"Username could not be found."}', $client->getResponse()->getContent());
43+
$this->assertJsonStringEqualsJsonString('{"error":"Invalid credentials."}', $client->getResponse()->getContent());
4444
}
4545
}
4646

Tests/Functional/FormLoginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testLoginThrottling()
142142

143143
break;
144144
case 2: // Third attempt with unexisting username
145-
$this->assertStringContainsString('Username could not be found.', $text, 'Invalid response on 3rd attempt');
145+
$this->assertStringContainsString('Invalid credentials.', $text, 'Invalid response on 3rd attempt');
146146

147147
break;
148148
case 3: // Fourth attempt : still login throttling !

0 commit comments

Comments
 (0)