37 Audits
πŸ”

X-Content-Type-Options Auditor

Security Auditor

Validates X-Content-Type-Options header for MIME sniffing protection

Security
20 credits
Per check
~30 seconds
Average runtime
Active
Status

How it works

  1. Fetch β€” sends a HEAD request (or GET when HEAD is not supported) to the audited URL as 37AuditsBot. A blocked request ends the audit with 590; any other failure (timeout, DNS, TLS, non-2xx answer) ends it with 500.

  2. Read β€” collects every X-Content-Type-Options header line and joins them with commas, as browsers do.

  3. First value β€” like browsers, looks only at the first comma-separated value and compares it with nosniff ignoring letter case. nosniff, nosniff passes; none, nosniff fails.

  4. Rules β€” a missing or empty header (400) and a first value other than nosniff (401) fail.

  5. Aggregate β€” when every rule passes the audit is SUCCESS (200).

  6. Specification pin β€” every run emits 37A-XContentTypeOptionsAuditor-100 (INFORMATION), naming the X-Content-Type-Options section of the WHATWG Fetch Living Standard as of 2026-10-15. It does not change the overall status.

What this auditor validates

Every row maps to one checkRule* method and one CheckCode, in the order the auditor runs them. CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error.

CheckCodeStatusWhen it firesRecommendationWhy it matters
37A-XContentTypeOptionsAuditor-100INFORMATIONAlways. Records the specification version this auditor implements.β€” (recommendation is null; nothing for the site to change)β€”
37A-XContentTypeOptionsAuditor-400FAILThe page sends no X-Content-Type-Options header, or an empty one.Add "X-Content-Type-Options: nosniff" to the responses of {url}.Without this header, browsers may guess a file's type and run an uploaded file as a script, opening the door to cross-site scripting attacks.
37A-XContentTypeOptionsAuditor-401FAILThe header is present but its first value is not nosniff.Replace "{value}" with "nosniff" in the X-Content-Type-Options header of {url}.Browsers ignore any value other than nosniff, so the site is as exposed to content-type guessing attacks as if the header were missing.
37A-XContentTypeOptionsAuditor-200SUCCESSAll rules passed. Message is X-Content-Type-Options on {url} is "{value}", so browsers do not guess content types.β€”β€”
37A-XContentTypeOptionsAuditor-500ERRORThe page could not be fetched (timeout, DNS, TLS, or a non-2xx answer other than a block).Make sure {url} answers with HTTP 2xx, then run the audit again. Last error: {error}.β€”
37A-XContentTypeOptionsAuditor-590ERRORThe audited page answered HTTP 403, HTTP 429 or a Cloudflare challenge, so 37AuditsBot was blocked before it could read the page.Allow 37AuditsBot in your firewall or bot protection: allowlist its user agent, or verify its Web Bot Auth signature. See https://www.37audits.com/bot.While 37AuditsBot is blocked this audit cannot look at the site, so problems on it go unreported.

Output Documentation

StatusDescriptionTest logic
SUCCESSBrowsers will not guess content types on this pageFirst header value is nosniff, any letter case (200).
FAILBrowsers may guess content types on this pageMissing or empty header (400); first value is not nosniff (401).
ERRORThe auditor could not read the pageFetch failure or non-2xx answer (500); site blocked 37AuditsBot (590).
INFORMATIONSpecification pinAlways emitted (100); does not change overall status.

Risks and Considerations

Why MIME sniffing is dangerous

  • Sites that serve user uploads (avatars, attachments, documents) are the classic target: a file uploaded as an image but containing HTML or JavaScript can be run by a browser that sniffs it, giving the attacker cross-site scripting on your domain.

  • With nosniff, browsers block scripts and stylesheets whose Content-Type is not a script or CSS type, and Chrome's cross-origin read blocking protects more responses.

Only nosniff counts

  • The header has one valid value. Browsers read the first comma-separated value only, so a typo such as no-sniff or a stray value placed first leaves the protection off without any error.

Setting it safely

  • Add the header to every response (pages, APIs and static files), usually once in the web server, CDN or framework configuration.

  • Make sure each response sends a correct Content-Type: with nosniff, a script served as text/plain stops loading.

What this auditor does not check

  • Only the audited URL is fetched; uploads, static assets and API responses may be served without the header.

  • The Content-Type of the response is not checked.

This documentation is built and hosted on Mintlify, a developer documentation platform.

Source: docs.37audits.com

Ready to start auditing?

Add this auditor to your monitoring setup and start identifying issues on your websites today.

Β© 2026 37 Audits. All rights reserved. Audit your websites with confidence.

Supported by

Made with ❀️ in Floripa