From c82d6e51536f4a7f72ad8968e78f8d2a6f7f220c Mon Sep 17 00:00:00 2001 From: Lukas Reschke <lukas@statuscode.ch> Date: Sun, 20 Jan 2013 12:06:33 +0100 Subject: [PATCH] Add CSP header --- lib/template.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/template.php b/lib/template.php index f7124ebc09..fa2df6c67e 100644 --- a/lib/template.php +++ b/lib/template.php @@ -186,10 +186,11 @@ class OC_Template{ $this->l10n = OC_L10N::get($parts[0]); // Some headers to enhance security - header('X-Frame-Options: Sameorigin'); - header('X-XSS-Protection: 1; mode=block'); - header('X-Content-Type-Options: nosniff'); - + header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains + header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters + header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE + header('Content-Security-Policy: script-src \'self\' \'unsafe-inline\'; object-src \'self\''); // Disallow external JS/Flash + eval() + $this->findTemplate($name); } -- GitLab