mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2026-11-20 23:43:26 +03:00
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:
1 parent
2bed4110a5
commit
52a7df2b3a
12 files changed
+17
No files matched your search
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user