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:
Sergio 2019-04-21 00:11:36 +02:00
commit 7603cdea7a
9 changed files with 49 additions and 1 deletions

View file

@ -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') {
if (!empty($_GET['pkg'])) {
$v_pkg = escapeshellarg($_GET['pkg']);