Add CSRF protection for POST requests

Add the CSRF token to all forms, and validate it when those forms are
submitted.

https://sourceforge.net/p/postfixadmin/bugs/372/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1842 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz committed 2016-05-20 20:42:04 +00:00
1 parent 2bed4110a5
commit 52a7df2b3a
12 files changed
+17

No files matched your search

+2
View File
@@ -52,6 +52,8 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!');
// user clicked on cancel button
if(isset($_POST['fCancel'])) {
header("Location: main.php");