nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.38k stars 4.07k forks source link

[Bug]: Setup check for `X-XXS-Protection` recommendation is deprecated #37154

Open jbouter opened 1 year ago

jbouter commented 1 year ago

⚠️ This issue respects the following points: ⚠️

Bug description

The Nextcloud administration page shows the following warning:

The "X-XSS-Protection" HTTP header does not contain "1; mode=block". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.

However, the X-XSS-Protection header is deprecated. OWASP recommends you remove the header from your webserver

It shows the following warning when the header is used:

Warning: The X-XSS-Protection header has been deprecated by modern browsers and its use can introduce additional security issues on the client side. As such, it is recommended to set the header as X-XSS-Protection: 0 in order to disable the XSS Auditor, and not allow it to take the default behavior of the browser handling the response. Please use Content-Security-Policy instead.

Steps to reproduce

  1. Log into a Nextcloud instance as admin
  2. Navigate towards the Administration > Overview page
  3. Observe the recommendation of Nextcloud to set the X-XSS-Protection header

Expected behavior

Do not show this recommendation, and possibly advice users to unset the HTTP header in order to inform them of its deprecation.

szaimen commented 1 year ago

Hi, which nc version?

jbouter commented 1 year ago

Hi @szaimen! Version is 25.0.4

kesselb commented 1 year ago

Related: https://github.com/nextcloud/server/issues/34748

aentwist commented 1 year ago

I am just getting set up and am already unsetting it in my web server layer. So for me the recommendation to add it back is just obnoxious.

Instead of setting it to 0, it should simply not be set.

This is bending this issue a little bit. Remove the whole thing instead of just the warning. I wouldn't remove the in-your-face part until the underlying problem is fixed.


Adding the MDN docs to this ~

These protections are largely unnecessary in modern browsers when sites implement a strong Content-Security-Policy that disables the use of inline JavaScript ('unsafe-inline').

Warning: Even though this feature can protect users of older web browsers that don't yet support CSP, in some cases, XSS protection can create XSS vulnerabilities in otherwise safe websites.


Non-comprehensive list for removal

And also


See also
magikmw commented 1 year ago

Still relevant for v26.0.4

fa-ve commented 11 months ago

Still relevant for: v27.1.3

psychedelicu commented 6 months ago

Still relevant for v28.0.5.1 :)

CoLuxe commented 5 months ago

And still for v29.0.1

Nextcloud still set this header automatically (See: Nextcloud Documentation ) and show the warning if you overwrite it with your webserver. Its deprecated and Nextcloud should not set this header.

Sabering1 commented 4 months ago

Still relevant