Skip to main content
HeadersLow PriorityFree

Deprecated X-XSS-Protection header

Updated November 2026·SecScanner Team

X-XSS-Protection was a browser feature to detect XSS attacks, but it's now deprecated and can actually introduce vulnerabilities.

24% of the 101 most-visited sites we scan fail this check. See the full data.

Results in 1–3 minutes · Free · No signup required

Want the result for your own site? Free Security Headers Checker — paste your domain, get the report.

Why It Matters

Modern browsers have removed XSS Auditor support. Using X-XSS-Protection can introduce security issues in older browsers. CSP is the recommended replacement.

How We Check

We read the X-XSS-Protection response header. The check passes when the header is absent or set to `0` (which disables the legacy filter, as OWASP recommends); any other value, such as `1` or `1; mode=block`, fails.

Good vs Bad Values

Good and bad values for Deprecated X-XSS-Protection header
ValueVerdictWhy
Header absentGoodThe recommended state. No current browser has a built-in XSS filter for this header to control, so there is nothing to configure.
Content-Security-Policy: script-src 'self' 'nonce-…'; object-src 'none'GoodWhat replaces the header. A nonce- or hash-based script policy blocks injected scripts in a way the old filter never did reliably.
X-XSS-Protection: 0GoodExplicitly turns the legacy filter off — the value OWASP recommends if the header must exist. It passes this check just like an absent header.
X-XSS-Protection: 1BadEnables the old filter in browsers that still had it, which could be abused to disable legitimate scripts on a page.
X-XSS-Protection: 1; mode=blockBadThe long-time recommended value. Block mode turned page-level behavior into a side channel that attackers used to infer information across origins.
X-XSS-Protection: 1; report=https://example.com/xss-reportBadReport mode only worked in Chromium's removed auditor. It now does nothing, and still marks the site as relying on a deprecated mechanism.
X-XSS-Protection: 1; mode=block set by Helmet before version 4 or an old templateBadA leftover from copy-pasted security-header lists. Remove it when you upgrade the library.
X-XSS-Protection: 0 set by Helmet 4 and laterGoodCurrent Helmet versions send 0 by default, which is correct and passes this check. Nothing to change.

How to Fix

Remove the X-XSS-Protection header and implement Content Security Policy instead. If you must keep it, use X-XSS-Protection: 0 to disable the filter.

Nginx: delete every add_header X-XSS-Protection ...; line. To strip a value added by an upstream application:

proxy_hide_header X-XSS-Protection;

Apache (requires mod_headers) — remove the Header set line, or unset a value added by the application:

Header always unset X-XSS-Protection
Header unset X-XSS-Protection

Express with Helmet: the default 0 already passes. To drop the header entirely:

app.use(helmet({ xXssProtection: false }));

Next.js: the framework does not set it, so remove any entry for X-XSS-Protection from the headers() array in next.config.js. Cloudflare: delete the Transform Rule or Page Rule that adds it, or add a rule that removes the header from responses. IIS: <remove name="X-XSS-Protection" /> inside customHeaders.

Replace it with CSP. A strict starting policy for a typical site is Content-Security-Policy: default-src 'self'; script-src 'self' 'nonce-RANDOM'; object-src 'none'; base-uri 'none'. See the Content Security Policy check for a staged rollout.

Verify with curl -sI https://example.com | grep -i x-xss-protection; the command should print nothing.

Common Mistakes

  • Adding `1; mode=block` because an old security checklist or scanner asked for it. Chrome removed its XSS Auditor in version 78, Edge dropped its filter in 2018, and Firefox never implemented one.
  • Treating the header as an XSS defence. It does not stop stored or DOM-based XSS and, in browsers that honoured it, was bypassable; the real controls are output encoding and Content-Security-Policy.
  • Removing the header and not adding a Content-Security-Policy. That swaps a no-op for a gap: a CSP with nonces or hashes is the actual replacement.
  • Keeping the header at the proxy while removing it from the application. Whichever layer adds it last wins, so verify the final response.
  • Confusing X-XSS-Protection with `X-Content-Type-Options` or `X-Frame-Options`, which are still useful and should stay.
  • Leaving a hard-coded `Header set X-XSS-Protection` line in `.htaccess` after migrating hosting; shared configuration files outlive the knowledge of why they were added.

Frequently Asked Questions

What is Deprecated X-XSS-Protection header?

X-XSS-Protection was a browser feature to detect XSS attacks, but it's now deprecated and can actually introduce vulnerabilities.

Why does Deprecated X-XSS-Protection header matter for website security?

Modern browsers have removed XSS Auditor support. Using X-XSS-Protection can introduce security issues in older browsers. CSP is the recommended replacement.

How do I fix Deprecated X-XSS-Protection header issues?

Remove the X-XSS-Protection header and implement Content Security Policy instead. If you must keep it, use X-XSS-Protection: 0 to disable the filter.

Related Security Checks

Related Tool

Security Headers Checker

Run all 10 related checks with our free security headers checker

Check Your Website Now

Run a free security scan to check for Deprecated X-XSS-Protection header issues and 61 other security checks.

Scan Your Website Free