mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 02:28:05 -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
|
@ -15,6 +15,12 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Check POST request
|
||||
if (!empty($_POST['ok'])) {
|
||||
|
||||
// Check token
|
||||
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
|
||||
header('location: /login/');
|
||||
exit();
|
||||
}
|
||||
|
||||
// Check empty fields
|
||||
if (empty($_POST['v_chain'])) $errors[] = __('banlist');
|
||||
if (empty($_POST['v_ip'])) $errors[] = __('ip address');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue