How can i solve "X-Content-Type-Options" and "X-Frame-Options" security risk?

Been trying to solve this for weeks but it is still not going away.

  • The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.
  • The "X-Frame-Options" HTTP header is not configured to equal to "SAMEORIGIN". This is a potential security or privacy risk and we recommend adjusting this setting.

OS: Ubuntu 16.04.3 LTS Nextcloud version: 12.0.4 Apache2 version: Apache/2.4.18 (Ubuntu)

Screenshot

Posted Dec 10, 2017, 5:36 AM UTC

11
BuurmanBolderbast•

Simply add the following lines to your /etc/apache2/apache.conf configuration file. This enables those options for all websites that are being served by your Apache instance. I believe these options can also be set on a per vhost basis.

Header set X-Frame-Options SAMEORIGIN

Header set X-Content-Type-Options nosniff

More info:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

https://scotthelme.co.uk/hardening-your-http-response-headers/

2