From a0930a5ad6e3cb9d02ee7d3e02a5d9918d53f5d6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 1 Aug 2014 23:22:41 +0200 Subject: [PATCH] Strict Referer domain against XSRF https://github.com/marienfressinaud/FreshRSS/issues/554 --- app/FreshRSS.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/FreshRSS.php b/app/FreshRSS.php index cd6048f75..3443589c6 100644 --- a/app/FreshRSS.php +++ b/app/FreshRSS.php @@ -6,8 +6,8 @@ class FreshRSS extends Minz_FrontController { } $loginOk = $this->accessControl(Minz_Session::param('currentUser', '')); $this->loadParamsView(); - if (Minz_Request::isPost() && !empty($_SERVER['HTTP_REFERER']) && - Minz_Request::getDomainName() !== parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)) { + if (Minz_Request::isPost() && (empty($_SERVER['HTTP_REFERER']) || + Minz_Request::getDomainName() !== parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST))) { $loginOk = false; //Basic protection against XSRF attacks Minz_Error::error( 403,