You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-07-29 22:41:11 +03:00
this should be a better PFA_Cookie random token value
This commit is contained in:
@ -117,7 +117,8 @@ function init_session(string $username, bool $is_admin = false, bool $mfa_comple
|
||||
$_SESSION['sessid']['mfa_complete'] = false;
|
||||
}
|
||||
$_SESSION['sessid']['username'] = $username;
|
||||
$_SESSION['PFA_token'] = md5(random_bytes(8) . uniqid('pfa', true));
|
||||
// Generate a more secure token using random_bytes and bin2hex instead of md5
|
||||
$_SESSION['PFA_token'] = bin2hex(random_bytes(16));
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user