mirror of
https://github.com/myvesta/vesta
synced 2025-07-06 04:51:54 -07:00
Add the validation of the CSRF token. It is missing in some cases when it is sent by GET or POST.
This commit is contained in:
parent
2da2c539f1
commit
7603cdea7a
9 changed files with 49 additions and 1 deletions
|
@ -5,6 +5,12 @@ ob_start();
|
|||
session_start();
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
header('location: /login/');
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
exec (VESTA_CMD."v-delete-cron-vesta-autoupdate", $output, $return_var);
|
||||
$_SESSION['error_msg'] = __('Autoupdate has been successfully disabled');
|
||||
|
|
|
@ -5,6 +5,12 @@ ob_start();
|
|||
session_start();
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Check token
|
||||
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
|
||||
header('location: /login/');
|
||||
exit();
|
||||
}
|
||||
|
||||
exec (VESTA_CMD."v-delete-cron-reports ".$user, $output, $return_var);
|
||||
$_SESSION['error_msg'] = __('Cronjob email reporting has been successfully disabled');
|
||||
unset($output);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue