CSACyber Security AuditWebbandflow
HTTP security headers

X-Content-Type-Options

A header that stops browsers from guessing a file's type, preventing some content-based attacks.

What it is

The X-Content-Type-Options header, set to nosniff, tells the browser to trust the declared type of a file rather than trying to guess it from its content. This guessing, known as MIME sniffing, can otherwise be abused to make a browser treat a harmless-looking file as something executable. The header is a simple, broadly recommended hardening step.

Why it matters

Preventing type guessing closes off attacks where a file is interpreted as a dangerous type it was not meant to be.

How to fix it

Send the X-Content-Type-Options header with the value nosniff on responses, and ensure content is served with correct content types.

Related terms

References

← Back to the glossary