Merge #18123 - Ref #16451 - Increase password characters limit to 2000 during login

Pull-request: #18123
Ref: #16451
Ref: #16452

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2023-03-10 15:49:09 +01:00
commit a8bfc4ceea
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889
2 changed files with 5 additions and 11 deletions

View File

@ -297,9 +297,9 @@ class AuthenticationCookie extends AuthenticationPlugin
$this->user = Core::sanitizeMySQLUser($_POST['pma_username']);
$password = $_POST['pma_password'] ?? '';
if (strlen($password) >= 1000) {
if (strlen($password) >= 2000) {
$conn_error = __('Your password is too long. To prevent denial-of-service attacks, ' .
'phpMyAdmin restricts passwords to less than 1000 characters.');
'phpMyAdmin restricts passwords to less than 2000 characters.');
return false;
}

View File

@ -749,22 +749,16 @@ class AuthenticationCookieTest extends AbstractNetworkTestCase
{
return [
[
str_repeat('a', 1000),
str_repeat('a', 2001),
false,
'Your password is too long. To prevent denial-of-service attacks,'
. ' phpMyAdmin restricts passwords to less than 1000 characters.',
],
[
str_repeat('a', 1001),
false,
'Your password is too long. To prevent denial-of-service attacks,'
. ' phpMyAdmin restricts passwords to less than 1000 characters.',
. ' phpMyAdmin restricts passwords to less than 2000 characters.',
],
[
str_repeat('a', 3000),
false,
'Your password is too long. To prevent denial-of-service attacks,'
. ' phpMyAdmin restricts passwords to less than 1000 characters.',
. ' phpMyAdmin restricts passwords to less than 2000 characters.',
],
[
str_repeat('a', 256),