mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Fix cryptographically insecure CSRF token bug
This commit is contained in:
parent
2f5c7a10b7
commit
cb7168f536
1 changed files with 2 additions and 2 deletions
|
@ -59,10 +59,10 @@ if ((!isset($_SESSION['user'])) && (!defined('NO_AUTH_REQUIRED'))) {
|
|||
exit;
|
||||
}
|
||||
|
||||
// Generate CSRF token
|
||||
if (isset($_SESSION['user'])) {
|
||||
if(!isset($_SESSION['token'])){
|
||||
$token = uniqid(mt_rand(), true);
|
||||
$_SESSION['token'] = $token;
|
||||
$_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(16));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue