Update X-XSS-Protection recommendation #53711
Closed
+8
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
X-XSS-Protection
recommendation is deprecated #37154Summary
While
1; mode=block
was seen as the most secure value for this header, some years ago, after possible side-channel attacks have become known, this turned towards0
being the best-practice value, disabling XSS filtering entirely for those old browsers who still support it.MDN web docs give some explanation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-XSS-Protection#security_considerations
The OWASP cheat sheet recommends
0
: https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html#x-xss-protectionHere the related discussion when this recommendation was updated: OWASP/CheatSheetSeries#376
A Stack Overflow question underlines the clear recommendation, adding some more details: https://stackoverflow.com/questions/9090577
Since
1; mode=block
is not a large security risk, it affects only very old browsers, and a changed recommendation will (sadly) trigger a lot of issues/topics in forum and GitHub, the old value however is allowed to pass the check. So to pass the check, either page blocking needs to be enabled along with XSS filtering, or XSS filtering needs to be disabled. The warning however will always suggest to disable it.TODO
.htaccess
Checklist