Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X-XSS-Protection: 0 is recommended by Mozilla and Google #19

Closed
DavidOsipov opened this issue Apr 23, 2022 · 2 comments
Closed

X-XSS-Protection: 0 is recommended by Mozilla and Google #19

DavidOsipov opened this issue Apr 23, 2022 · 2 comments

Comments

@DavidOsipov
Copy link

DavidOsipov commented Apr 23, 2022

Currently, Mozilla and Google do not recommend setting X-XSS-Protection to enabled state due to the fact that the XSS auditor can even create new XSS vulnerabilities in otherwise secure websites. X-XSS-Protection: 0 is preferred.

@dvershinin
Copy link
Contributor

I'm not sure what would be the best to do here:

Setting the X-XSS-Protection header to either 0 or 1; mode=block prevents vulnerabilities like the one described above

... while bringing back XSS vulnerability from having disabled XSS filtering. Then for best security, it would be sending 1; mode=block as they suggest.

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').

Perhaps a better option would be sending X-XSS-Protection: 0 only if Content-Security-Policy is set in the response? (always sending either 0 or 1; mode=block doesn't seem like a great default).

@DavidOsipov
Copy link
Author

Dead weight issue - closing.

dvershinin added a commit that referenced this issue Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants