Quick fix
Set correct `Content-Type` values for every response and uploaded file.
What this finding means
SecuTest requires the HTTPS response header value `nosniff`. The control is small but useful defense in depth, especially for script and stylesheet responses and user-controlled uploads.
Associated attack or threat scenario
How the attack or failure scenario works
MIME sniffing is a browser behavior that guesses a response type from its bytes. If an attacker can upload or influence content served with an incorrect type, the browser may execute it as script or stylesheet. `nosniff` tells compatible browsers to respect the declared `Content-Type`.
Conditions and limitations
- Attacker-controlled or misclassified content is served from a trusted origin.
- The response has an incorrect or ambiguous `Content-Type`.
- The browser would otherwise sniff the content into an executable type.
Why it matters
Step-by-step fix
Where to make the change
- The outermost component emitting the public HTTP response: CDN, reverse proxy, ingress, web server, or application middleware.
- Apply the control consistently to normal pages, redirects, error responses, and relevant subdomains.
Remediation procedure
- Set correct `Content-Type` values for every response and uploaded file.
- Add `X-Content-Type-Options: nosniff` at the outermost public response layer.
- Store untrusted uploads on a separate origin and force safe download handling where appropriate.
- Test scripts, styles, JSON, downloads, and error responses after deployment.
Commands and configuration examples
Replace example values with the hostname, selector, IP address, port, provider, or policy values shown in your SecuTest evidence. Review every example before production use.
add_header X-Content-Type-Options "nosniff" always;
Header always set X-Content-Type-Options "nosniff"
Use a Response Header Transform Rule to set X-Content-Type-Options to nosniff.
Verify the fix
- Inspect response headers with curl.
- Confirm the value is exactly `nosniff`.
- Verify JavaScript and CSS resources still load with correct MIME types.
- Test representative user-upload and download paths.
After DNS, CDN, certificate, mail, or application propagation completes, run a fresh SecuTest scan and compare the new evidence with the original finding.
Common mistakes
- Adding `nosniff` while serving JavaScript as `text/plain`, causing legitimate breakage.
- Applying the header only to the home page.
- Using the header as a substitute for upload isolation and correct MIME handling.