diff --git a/interface/billing/edi_history_main.php b/interface/billing/edi_history_main.php index 1e15f4de5..434de427f 100644 --- a/interface/billing/edi_history_main.php +++ b/interface/billing/edi_history_main.php @@ -70,6 +70,7 @@ require_once("$srcdir/edihistory/ibr_ack_read.php"); //dirname(__FILE__) . "/edihist/ibr_ack_read.php"); require_once("$srcdir/edihistory/ibr_uploads.php"); //dirname(__FILE__) . "/edihist/ibr_uploads.php"); require_once("$srcdir/edihistory/ibr_io.php"); //dirname(__FILE__) . "/edihist/ibr_io.php"); +require_once("../../library/CsrfToken.php"); // // php may output line endings if include files are utf-8 ob_clean(); @@ -100,6 +101,14 @@ */ if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { + if (!empty($_POST)) { + if (!isset($_POST['token'])) { + error_log('WARNING: A POST request detected with no csrf token found'); + die('Authentication failed.'); + } else if (!(CsrfToken::verifyCsrfToken($_POST['token'])) { + die('Authentication failed.'); + } + } // if ( isset($_POST['NewFiles']) ) { // process new files button clicked diff --git a/interface/billing/edih_view.php b/interface/billing/edih_view.php index dc76f7b7e..af5a45458 100644 --- a/interface/billing/edih_view.php +++ b/interface/billing/edih_view.php @@ -75,6 +75,7 @@ " /> + @@ -87,6 +88,7 @@ " /> + @@ -159,6 +161,7 @@ -->