Sentora Support Forums
Is it safe if comment out CSRF TOKEN? | Fix Application Error: [0204] - Printable Version

+- Sentora Support Forums (https://senforums.mach-hosting.com)
+-- Forum: Sentora Forum Archives (https://senforums.mach-hosting.com/forumdisplay.php?fid=5)
+--- Forum: Sentora Public Support Forums v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=32)
+---- Forum: General Support Forum v1.0.x (https://senforums.mach-hosting.com/forumdisplay.php?fid=36)
+---- Thread: Is it safe if comment out CSRF TOKEN? | Fix Application Error: [0204] (/showthread.php?tid=4373)



Is it safe if comment out CSRF TOKEN? | Fix Application Error: [0204] - Hadhill - 02-23-2018

Hello. 
I just installed sentora for my centos 7 vps, installation is successful but when i try to login panel and i got message

"Application Error: [0204] - The form you attempted to submit had an invalid token!"

Fresh Re-installing sentora didn't work for me. Then i found the solution from here (just retake from archive.org) thanks dave Ozoalor from braintem.

Here is the tutorial

Quote:1. Search csfr.class.php

Code:
find / -name "csfr.class.php"


2. Open csfr.class.php (sentora directory= /etc/sentora/panel/dryden/runtime/csfr.class.php) with text editor and Comment out everything in the protect() function like this: Be careful not to comment out the function itself. Just comment out all what is inside.


PHP Code:
static function Protect() {
 
    /*
        if (isset($_POST['csfr_token']) && ($_POST['csfr_token'] == $_SESSION['zpcsfr'])) {
            self::Tokeniser();
            return true;
        }
        $error_html = "<style type=\"text/css\"><!--
            .dbwarning {
                    font-family: Verdana, Geneva, sans-serif;
                    font-size: 14px;
                    color: #C00;
                    background-color: #FCC;
                    padding: 30px;
                    border: 1px solid #C00;
            }
            p {
                    font-size: 12px;
                    color: #666;
            }
            </style>
            <div class=\"dbwarning\"><strong>Application Error:</strong> [0204] - The form you attempted to submit had an invalid token!</p></div>";
        die($error_html);
        */
 
   


That is work for me, but is it safe?


RE: Is it safe if comment out CSRF TOKEN? | Fix Application Error: [0204] - TGates - 02-24-2018

No. That bit of code helps protect against CSRF hijacking. https://en.wikipedia.org/wiki/Cross-site_request_forgery
If you are getting the error, there is something not right.

Try clearing your browser's cookies and cache.
Do not use the 'back' button at all when logged into the panel.

@[Me.B] Any other suggestions?


RE: Is it safe if comment out CSRF TOKEN? | Fix Application Error: [0204] - Me.B - 02-24-2018

Do you accept cookies? Seem you have an issue with your browser and you are never adviced to disabled CSRF.

M B