Commit f7b3d318 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch 'cherry-pick-7d9a58d9' into '1.2.1-fixes'

Merge branch '5842-security-missing-security-headers' into '1.2.1-fixes'

See merge request fusiondirectory/fd!306
Showing with 12 additions and 0 deletions
+12 -0
...@@ -104,6 +104,8 @@ class standAlonePage { ...@@ -104,6 +104,8 @@ class standAlonePage {
load_plist(); load_plist();
$ssl = $this->checkForSSL(); $ssl = $this->checkForSSL();
static::securityHeaders();
} }
} }
...@@ -221,6 +223,13 @@ class standAlonePage { ...@@ -221,6 +223,13 @@ class standAlonePage {
return $params; return $params;
} }
static function securityHeaders()
{
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: deny');
}
static function generateRandomHash() static function generateRandomHash()
{ {
/* Generate a very long random value */ /* Generate a very long random value */
......
...@@ -29,6 +29,7 @@ require_once ("class_logging.inc"); ...@@ -29,6 +29,7 @@ require_once ("class_logging.inc");
header('Content-type: text/html; charset=UTF-8'); header('Content-type: text/html; charset=UTF-8');
header('X-XSS-Protection: 1; mode=block'); header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff'); header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: deny');
/* Display the login page and exit() */ /* Display the login page and exit() */
function displayLogin() function displayLogin()
......
...@@ -31,6 +31,7 @@ require_once ("variables.inc"); ...@@ -31,6 +31,7 @@ require_once ("variables.inc");
header('Content-type: text/html; charset=UTF-8'); header('Content-type: text/html; charset=UTF-8');
header('X-XSS-Protection: 1; mode=block'); header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff'); header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: deny');
/* Set the text domain as 'fusiondirectory' */ /* Set the text domain as 'fusiondirectory' */
$domain = 'fusiondirectory'; $domain = 'fusiondirectory';
......
...@@ -39,6 +39,7 @@ require_once("../setup/class_setupStepFinish.inc"); ...@@ -39,6 +39,7 @@ require_once("../setup/class_setupStepFinish.inc");
header('Content-type: text/html; charset=UTF-8'); header('Content-type: text/html; charset=UTF-8');
header('X-XSS-Protection: 1; mode=block'); header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff'); header('X-Content-Type-Options: nosniff');
header('X-Frame-Options: deny');
/* Set cookie lifetime to one day (The parameter is in seconds ) */ /* Set cookie lifetime to one day (The parameter is in seconds ) */
session_set_cookie_params(24 * 60 * 60); session_set_cookie_params(24 * 60 * 60);
......
  • bmortier @bmortier

    mentioned in commit e52d5156

    By Côme Chilliet on 2020-06-11T14:33:27 (imported from GitLab)

    ·

    mentioned in commit e52d5156

    By Côme Chilliet on 2020-06-11T14:33:27 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in merge request !784

    By bmortier on 2020-06-11T14:33:35 (imported from GitLab)

    ·

    mentioned in merge request !784

    By bmortier on 2020-06-11T14:33:35 (imported from GitLab)

    Toggle commit list
  • bmortier @bmortier

    mentioned in commit 7f1412da

    By bmortier on 2020-06-11T14:34:25 (imported from GitLab)

    ·

    mentioned in commit 7f1412da

    By bmortier on 2020-06-11T14:34:25 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment