---
title: "No X-Content-Type-Options: nosniff"
description: "Without nosniff, browsers may guess a file's type from its contents, which can let an uploaded file run as a script."
url: https://ursy.com/issues/x-content-type-options-missing/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/x-content-type-options-missing/
---

# No X-Content-Type-Options: nosniff

> Without nosniff, browsers may guess a file's type from its contents, which can let an uploaded file run as a script.

Without nosniff, browsers may guess a file's type from its contents, which can let an uploaded file run as a script.

## Why it matters {#why-it-matters}

Browsers sometimes ignore the Content-Type a server sends and guess the type from the bytes. That guessing, called MIME sniffing, can let a file uploaded as a picture or text be run as a script or a page.

X-Content-Type-Options: nosniff turns the guessing off. It is a one-line header with almost no risk, and nosniff is the only value it takes.

## How to fix it {#how-to-fix-it}

Send "X-Content-Type-Options: nosniff" on every answer, and make sure each file is sent with its correct Content-Type, such as text/css for stylesheets and text/javascript for scripts.

Most hosts, CDNs and security plugins can add it. Check with the Security Headers Checker.

### What the problem looks like {#what-the-problem-looks-like}

```
X-Content-Type-Options: nosnif
```

A misspelt value, which browsers ignore. Leaving the header out has the same effect.

### What it looks like fixed {#what-it-looks-like-fixed}

```
X-Content-Type-Options: nosniff
```

nosniff is the only value. Send it on every answer, with the correct Content-Type for each file.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me add a security header to [your website address], which runs on [your platform or server, e.g. WordPress on Apache]. A checker says answers have no "X-Content-Type-Options: nosniff", so browsers may guess a file's type and run an uploaded file as a script. First check: run "curl -sI" on the home page, one stylesheet and one script file (or ask me to paste the headers), and report the X-Content-Type-Options value and the Content-Type of each file. Explain plainly what you found, and flag any file served with the wrong Content-Type, because nosniff will make the browser refuse those scripts and styles. Then give me the exact change: send "X-Content-Type-Options: nosniff" on every answer, in one place only, and correct any wrong Content-Type first. Rules: back up configuration first, keep all other headers, and change nothing else. Give the exact line and where it goes. Finally, tell me to re-check with the URSY.com Security Headers Checker at ursy.com/security-headers-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

Most security plugins can add it, or add Header always set X-Content-Type-Options "nosniff" to .htaccess on Apache hosting.

### Your server or hosting {#your-server-or-hosting}

On nginx add add_header X-Content-Type-Options "nosniff" always; at server level. On Apache use Header always set X-Content-Type-Options "nosniff".

### Your CDN (for example Cloudflare) {#your-cdn-for-example-cloudflare}

On Cloudflare, a response header Transform Rule can add it to every answer.

## Check it is fixed {#check-it-is-fixed}

Run the Security Headers Checker again: it should find X-Content-Type-Options set to nosniff. Check the page still looks and works the same.

## Official source {#official-source}

[MDN: X-Content-Type-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/X-Content-Type-Options)

## Questions {#questions}

### Can nosniff break anything? {#can-nosniff-break-anything}

Only files sent with the wrong type: a script that is not sent as JavaScript, or a stylesheet that is not text/css, will be refused. Fix the type and it works.

### Do I need a developer? {#do-i-need-a-developer}

Usually not. It is one line in a security plugin, the server settings or the [CDN](https://ursy.com/wiki/cdn/).

---

**Cite this page:** No X-Content-Type-Options: nosniff. URSY.com. Updated 30 November 2026. https://ursy.com/issues/x-content-type-options-missing/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[No X-Content-Type-Options: nosniff](https://ursy.com/issues/x-content-type-options-missing/), URSY.com`. One section: add its id, for example https://ursy.com/issues/x-content-type-options-missing/#section-id (every heading above has one).

Section links: https://ursy.com/citations/15/#p-5748 · How to cite URSY.com: https://ursy.com/citations/

---

**For AI assistants**

- This page: https://ursy.com/issues/x-content-type-options-missing/
- As JSON: https://ursy.com/issues/x-content-type-options-missing/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
