Preventing uploads from other origin

Credits to:  Fady Othman, Security Consultant # ZINAD IT
This commit is contained in:
myvesta 2021-03-14 20:49:14 +01:00 committed by GitHub
commit 3402071e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,13 @@
//session_start();
$hostname = exec('hostname');
$port = $_SERVER['SERVER_PORT'];
$expected_http_origin="https://".$hostname.":".$port;
if ($_SERVER['HTTP_ORIGIN'] != $expected_http_origin) {
die ("Nope.");
}
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check login_as feature