From 58245cb1cc25a1b167941cf30a4cc742a27c0b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 18 Aug 2016 09:15:34 +0200 Subject: [PATCH] Use hash_equals for comparing username in allow/deny rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comparison should happen in constant time to avoid possible leak of usernames in rules. Signed-off-by: Michal Čihař --- libraries/ip_allow_deny.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ip_allow_deny.lib.php b/libraries/ip_allow_deny.lib.php index 9e359f0c94..233ba44b75 100644 --- a/libraries/ip_allow_deny.lib.php +++ b/libraries/ip_allow_deny.lib.php @@ -306,7 +306,7 @@ function PMA_allowDeny($type) // check for username if (($rule_data[1] != '%') //wildcarded first - && ($rule_data[1] != $username) + && (! hash_equals($rule_data[1], $username)) ) { continue; }