Skip to content
// glossary

What is X-Content-Type-Options?

also: nosniff

// short answer

A security header with one value, nosniff, that stops browsers guessing a file's type and running something as a script when it should not.

In plain English

Browsers sometimes try to be helpful by "sniffing" a file to guess what it really is, ignoring the type the server declared. Attackers can exploit that guessing to get an uploaded file treated as a script or stylesheet.

The whole header
X-Content-Type-Options: nosniff

X-Content-Type-Options: nosniff tells the browser to trust the declared type and refuse scripts and styles whose type does not match. It has only one valid value, so it is about as simple as security headers get.

Why it matters to a small business

Sites that accept uploads — CVs, images, documents — benefit most. For everyone else it is a free, zero-risk safety catch that is expected on any well-configured site.

What to do

Add the header at your server, host or CDN for every response. Many hosts offer it as a tick-box. Confirm with the security headers checker.

Does your site get X-Content-Type-Options right?

Find out in about 30 seconds with the free, passive check. Nothing is attacked and nothing is stored.

Talk to a human