X-Content-Type-Options: nosniff is set
Why it matters
MIME-sniffing is the browser behavior where, if a server sends a response with a wrong or ambiguous Content-Type, the browser guesses what the content actually is and renders it accordingly. An attacker who can upload a file that looks like a script — even if it's served as text/plain — can trigger script execution if MIME-sniffing is allowed. CWE-430 (Deployment of Wrong Handler) and CWE-436 (Interpretation Conflict) both map to this class of confusion attack. The nosniff directive costs nothing to deploy and closes a class of content-confusion exploits that bypass file type restrictions on upload endpoints.
Severity rationale
Medium because MIME-type confusion attacks require attacker-controlled file upload but can escalate to script execution if content-type handling is ambiguous.
Remediation
Add X-Content-Type-Options: nosniff to your global header configuration. This is a zero-configuration, zero-compatibility-risk fix.
// next.config.js
headers: [{
key: 'X-Content-Type-Options',
value: 'nosniff'
}]
If you use Express, helmet() sets this automatically. For other frameworks, add the header in your response middleware. The value must be exactly nosniff — no other values are recognized by browsers.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Security Headers & Basics Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-430 — Deployment of Wrong Handler
- cwe · CWE-436 — Interpretation Conflict
- owasp:2021 · A05 — Security Misconfiguration
- soc2:2017 · CC6.6 — Protection against threats from outside system boundaries
Taxons
History
- 2026-04-17·v1.0.0·Initial import from security-headers·automated
- 2026-07-06·v1.0.1·Add SOC 2 TSC mapping (CC6.6) from the verified compliance crosswalk register (docs/compliance/).·by soc2-mapping-enrichment-ship-2