X-Content-Type-Options: nosniff

Why the X-Content-Type-Options header should be set to nosniff, and the one line that adds it on any server.

What AuditX checks

The scan checks that your response carries X-Content-Type-Options with the value nosniff.

Why it matters

Browsers sometimes guess a file type from its contents instead of trusting the Content-Type the server sent. That guessing, called MIME sniffing, can make a browser run an uploaded text or image file as a script.

nosniff switches the guessing off, so a file is only ever treated as the type your server says it is.

How to fix it

  1. Add the header to every response, at the web server, CDN or framework level.
  2. Check that your server sends correct Content-Type headers for scripts and stylesheets, because with nosniff a script served as text/plain will no longer run.
X-Content-Type-Options: nosniff

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.