X-Content-Type-Options (X-Content-Type-Options)
Why X-Content-Type-Options Matters
Without X-Content-Type-Options: nosniff, browsers may interpret a file differently from what the server intended. An attacker who can upload a file with a .jpg extension but containing JavaScript could trick the browser into executing it as a script if the browser sniffs the content and detects JavaScript.
This header is simple to implement and has no legitimate reason to be omitted. It consists of a single directive (nosniff) that tells the browser to trust the Content-Type header and not attempt to guess. There are no configuration options, no compatibility concerns with modern browsers, and no risk of breaking functionality.
X-Content-Type-Options is consistently recommended by security scanners and is part of the baseline security headers every site should set. Along with X-Frame-Options and a basic CSP, it forms the minimum security header set.
Checking Your Setup
Check X-Content-Type-Options on representative HTML, script, style, and download responses. "nosniff" is the modern value, but also serve accurate Content-Type headers and test downloads and legacy integrations. DomainOptic reports the public response it receives, not every response on the site.
Run a Security Audit