mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 18:59:48 +01:00
Use hash_equals when comparing to pwhash from cookie
This should prevent a timing attack against this parameter to disclose the stored passsword hash. Signed-off-by: Aidan Woods <aidantwoods@gmail.com>
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
// Check for and authorize from persistent cookie
|
||||
if (isset($_COOKIE["persistentlogin"]))
|
||||
{
|
||||
if ($pwhash === $_COOKIE["persistentlogin"])
|
||||
if (hash_equals($pwhash, $_COOKIE["persistentlogin"]))
|
||||
{
|
||||
$auth = true;
|
||||
// Refresh cookie with new expiry
|
||||
|
||||
Reference in New Issue
Block a user