From b305ec30fad7d4153b601d4f56447fe5bc27cc9b Mon Sep 17 00:00:00 2001 From: Yuval Haor Noga Date: Sun, 19 Feb 2023 17:03:18 +0200 Subject: [PATCH] Ref #16451 - Increase max password length from 1000 to 2000 Signed-off-by: Yuval Haor Noga --- .../classes/Plugins/Auth/AuthenticationCookie.php | 4 ++-- .../Plugins/Auth/AuthenticationCookieTest.php | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/libraries/classes/Plugins/Auth/AuthenticationCookie.php index e083ddf19a..db895a6508 100644 --- a/libraries/classes/Plugins/Auth/AuthenticationCookie.php +++ b/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -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; } diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index b1c8379ab5..034138a9cd 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -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),