Skip to content
FixSecurityHeadersScan a site

X-Content-Type-Options explained

Last updated · Reviewed by a CISSP-certified security practitioner

X-Content-Type-Options: Setting nosniff makes the browser trust the Content-Type you send instead of guessing, so an uploaded text file can't be executed as script. Recommended value: nosniff.

What risk does it prevent?

MIME sniffing can turn user uploads or JSON responses into executable scripts or styles.

What is the safe recommended value?

X-Content-Type-Options: nosniff

What are the gotchas?

  • Make sure your server sends correct Content-Type headers, or some assets will stop loading.

Which compliance controls reference it?

  • OWASP ASVS V14.4.4
  • SOC 2 CC6.8

How do I add it on my stack?

Check your site now

Free scan, instant grade, exact fixes for your stack.

Other security headers