[2/2] Apache: deny framing of WebUI from different origins

Message ID e0dd8324-866c-28c8-9e03-12866e132cce@ipfire.org
State Accepted
Commit be8afd151f95cf6b2a77e73524c42628600cd543
Headers
Series [1/2] Apache: prevent Referrer leaks via WebUI |

Commit Message

Peter Müller Nov. 4, 2019, 6:53 p.m. UTC
  There is no legitimate reason to do this. Setting header X-Frame-Options
to "sameorigin" is necessary for displaying some collectd graphs on the
WebUI.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 config/httpd/vhosts.d/ipfire-interface-ssl.conf | 1 +
 config/httpd/vhosts.d/ipfire-interface.conf     | 1 +
 2 files changed, 2 insertions(+)
  

Comments

Michael Tremer Nov. 5, 2019, 10:34 a.m. UTC | #1
Acked-by: Michael Tremer <michael.tremer@ipfire.org>

> On 4 Nov 2019, at 18:53, peter.mueller@ipfire.org wrote:
> 
> There is no legitimate reason to do this. Setting header X-Frame-Options
> to "sameorigin" is necessary for displaying some collectd graphs on the
> WebUI.
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> config/httpd/vhosts.d/ipfire-interface-ssl.conf | 1 +
> config/httpd/vhosts.d/ipfire-interface.conf     | 1 +
> 2 files changed, 2 insertions(+)
> 
> diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> index dc1151110..de7b8559d 100644
> --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> @@ -23,6 +23,7 @@
>     Header always set X-Content-Type-Options nosniff
>     Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
>     Header always set Referrer-Policy strict-origin
> +    Header always set X-Frame-Options sameorigin
> 
>     <Directory /srv/web/ipfire/html>
>         Options ExecCGI
> diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
> index d95fa264f..2cf57dd29 100644
> --- a/config/httpd/vhosts.d/ipfire-interface.conf
> +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> @@ -9,6 +9,7 @@
>     Header always set X-Content-Type-Options nosniff
>     Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
>     Header always set Referrer-Policy strict-origin
> +    Header always set X-Frame-Options sameorigin
> 
>     <Directory /srv/web/ipfire/html>
>         Options ExecCGI
> -- 
> 2.16.4
  

Patch

diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
index dc1151110..de7b8559d 100644
--- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
+++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
@@ -23,6 +23,7 @@ 
     Header always set X-Content-Type-Options nosniff
     Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
     Header always set Referrer-Policy strict-origin
+    Header always set X-Frame-Options sameorigin
 
     <Directory /srv/web/ipfire/html>
         Options ExecCGI
diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
index d95fa264f..2cf57dd29 100644
--- a/config/httpd/vhosts.d/ipfire-interface.conf
+++ b/config/httpd/vhosts.d/ipfire-interface.conf
@@ -9,6 +9,7 @@ 
     Header always set X-Content-Type-Options nosniff
     Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
     Header always set Referrer-Policy strict-origin
+    Header always set X-Frame-Options sameorigin
 
     <Directory /srv/web/ipfire/html>
         Options ExecCGI