webhintio / hint

💡 A hinting engine for the web
https://webhint.io/
Apache License 2.0
3.62k stars 684 forks source link

Add rule(s) to check the usage of the `X-XSS-Protection` HTTP header #20

Open alrra opened 7 years ago

alrra commented 7 years ago

See also:

Malvoz commented 5 years ago

While sending this header is still effective in older browsers, it may be considered deprecated:

We are retiring the XSS filter in Microsoft Edge beginning in today’s build. Our customers remain protected thanks to modern standards like Content Security Policy, which provide more powerful, performant, and secure mechanisms to protect against content injection attacks, with high compatibility across modern browsers.

If a site is using CSP, without allowing unsafe-inline for scripts then X-XSS-Protection has very little value.

Seirdy commented 2 years ago

Safari has removed this header. However, Safari updates are tied to iOS updates (and to a lesser degree, macOS updates). For that reason, versions of Safari that include the XSS filter will still be in use for a few years.

OWASP recommends sending X-XSS-Protection: 0 because the XSS auditor ironically exposes vulnerabilities. See https://owasp.org/www-project-secure-headers/#div-headers