Vulnerability remediation
This commit is contained in:
22
signin_2.php
22
signin_2.php
@@ -19,9 +19,11 @@
|
||||
ini_set('session.gc_maxlifetime', 24*60*60); // MIN SESSION
|
||||
ini_set('session.gc_probability', 1); // GC RATES
|
||||
ini_set('session.gc_divisor', 100); // TIMES
|
||||
ini_set("session. cookie_httponly", 1);
|
||||
session_save_path('.tmp'); // TEMP
|
||||
session_start(); // START
|
||||
require_once __DIR__ . '/autoload.php'; // AUTOLOAD
|
||||
use App\LobbySIO\Misc\Csrf; // ANTICSRF
|
||||
$StaticFunctions = new \App\LobbySIO\Misc\StaticFunctions(); // DEFAULT CLASSES
|
||||
$SiteInfo = new \App\LobbySIO\Database\SiteInfo();
|
||||
$Users = new \App\LobbySIO\Database\Users();
|
||||
@@ -46,17 +48,24 @@
|
||||
require_once("inc/header.inc.php");
|
||||
if ($StaticFunctions->getSessionStatus() == true) { // CHECK STATUS
|
||||
header('Location: index.php'); // ELSE HOME
|
||||
} else { ?>
|
||||
} else {
|
||||
header("X-Frame-Options: SAMEORIGIN");
|
||||
header("Content-Security-Policy: frame-ancestors 'none'", false);
|
||||
if (!empty($_GET['a'])) {
|
||||
echo '<pre>' . print_r($_POST, true) . '</pre>';
|
||||
echo 'Verification has been : ' . (Csrf::verifyToken('home') ? 'successful' : 'unsuccessful');
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<!-- START CONTENT -->
|
||||
<?php if (!empty($_POST)) { // PROCESS POST
|
||||
if (empty($_POST['carnum'])) { $carnum="";} else {$carnum=$_POST['carnum'];};
|
||||
if (empty($_POST['ssanum'])) { $ssanum="";} else {$ssanum=$_POST['ssanum'];};
|
||||
if (empty($_POST['firstname'])) { $firstname="";} else {$firstname=$_POST['firstname'];};
|
||||
if (empty($_POST['lastname'])) { $lastname="";} else {$lastname=$_POST['lastname'];};
|
||||
if (empty($_POST['company'])) { $company="";} else {$company=$_POST['company'];};
|
||||
if (empty(filter_input(INPUT_POST, 'carnum', FILTER_SANITIZE_STRING))) { $carnum="";} else {$carnum=filter_input(INPUT_POST, 'carnum', FILTER_SANITIZE_STRING);};
|
||||
if (empty(filter_input(INPUT_POST, 'ssanum', FILTER_SANITIZE_STRING))) { $ssanum="";} else {$ssanum=filter_input(INPUT_POST, 'ssanum', FILTER_SANITIZE_STRING);};
|
||||
if (empty(filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING))) { $firstname="";} else {$firstname=filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING);};
|
||||
if (empty(filter_input(INPUT_POST, 'lastname', FILTER_SANITIZE_STRING))) { $lastname="";} else {$lastname=filter_input(INPUT_POST, 'lastname', FILTER_SANITIZE_STRING);};
|
||||
if (empty(filter_input(INPUT_POST, 'company', FILTER_SANITIZE_STRING))) { $company="";} else {$company=filter_input(INPUT_POST, 'company', FILTER_SANITIZE_STRING);};
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row row-cols-1">
|
||||
@@ -65,6 +74,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<form name="form-signin" class="form-signin" action="signin_3.php" method="post">
|
||||
<?php echo Csrf::getInputToken('home') ?>
|
||||
<div class="row row-cols-1">
|
||||
<div class="col">
|
||||
<div class="input-group mb-3">
|
||||
|
||||
Reference in New Issue
Block a user