diff --git a/lib/headers.php b/lib/headers.php
index 8041c2f..3834271 100644
--- a/lib/headers.php
+++ b/lib/headers.php
@@ -7,7 +7,7 @@ if (!isset($_SESSION["csrf"])) {
$_SESSION["csrf"] = md5(uniqid(mt_rand(), true));
}
-if (($_GET || $_POST) && $_REQUEST["csrf"] !== $_SESSION["csrf"]) {
+if (($_GET || $_POST) && (!isset($_REQUEST["csrf"]) || $_REQUEST["csrf"] !== $_SESSION["csrf"])) {
die("Bad CSRF token. Please report the error info at https://github.com/mattpass/ICEcoder so it can be fixed.
CSRF issue:
REQUEST: ".$_REQUEST["csrf"]."