Loading...
Loading...
Prevents the browser from "guessing" the file type (MIME sniffing) and forces it to trust the server's declared type.
If you allow users to upload images, an attacker might upload a file named `image.jpg` that actually contains malicious JavaScript. Without this header, Internet Explorer and older Chrome versions might look at the file content, see script tags, and execute it as JavaScript (XSS). This header says "No, I said it is a JPEG, treat it as a JPEG."
The only valid value is `nosniff`. This is a set-and-forget header that should be on every response.
This is a one-line header. Either `nosniff` is present on every response or it is not. Check your origin and any subdomain that serves user-uploaded content.
curl -sI https://yourdomain.com | grep -i x-content-type-optionscurl -sI https://uploads.yourdomain.com/some-file.jpg | grep -i x-content-type-optionsYes. An attacker-uploaded "image" that actually contains HTML could be sniffed and rendered as HTML in legacy browsers. `nosniff` forces the declared `Content-Type` to be honored across every response type.
Only if you are serving content with the wrong `Content-Type` today. That is already a bug; `nosniff` surfaces it. Fix the MIME mappings, then the header is safe to ship globally.
`application/json`. `text/plain` or `text/html` for JSON responses will be blocked by modern browsers when `nosniff` is present, and some XSS defenses (like CORB/ORB) depend on correct MIME labeling.
Applied the configuration change? Run a live scan to confirm the vulnerability is patched.