Skip to content
Skillpedia
Security75k · #3090

x-content-type

What it does

This skill checks that a web server sends the nosniff security header. It is for developers and IT staff who harden websites against common attacks.

When to use it

  • ✓When a server's responses do not include the X-Content-Type-Options header.
  • ✓When a security checklist asks for header hardening.
  • ✓When files are uploaded and then served back to visitors.

Skill link

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Our security scan says we are missing the X-Content-Type-Options header. Can you add it?”

5 new skills a week. 1 minute to read.

How it works

The agent adds the header to the server or framework configuration for all responses. It then checks the response headers to confirm the header is present.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Set X-Content-Type-Options: nosniff

Browsers that MIME-sniff can be tricked into executing malicious JavaScript uploaded as an image — even if the server sends Content-Type: image/png. nosniff forces the browser to honor the declared type.

Quick Reference

  • Set X-Content-Type-Options: nosniff on all responses — the only valid value is nosniff
  • Without this header, browsers may execute a JavaScript file disguised as an image if the server serves it with the wrong MIME type
  • This header is required by OWASP's security hardening checklist and the Fetch specification
  • Pair with correct Content-Type headers on all responses for defense in depth
  • Takes 5 minutes to configure and has no compatibility issues

Check

Check whether the server sends an X-Content-Type-Options: nosniff header on responses. Verify the header is present on HTML pages, scripts, stylesheets, and API responses.

Fix

Add X-Content-Type-Options: nosniff to all HTTP responses. Configure it at the web server level (Nginx, Apache) or in your application framework, and verify with curl -I https://example.com.

Explain

Explain what MIME type sniffing is, how it can be exploited to execute malicious files, and how X-Content-Type-Options: nosniff prevents this attack.

Code Review

Review server config, headers, forms, and integration points related to Set X-Content-Type-Options: nosniff. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/x-content-type

FAQ

What does nosniff do?

It tells browsers to trust the declared file type, instead of guessing it and possibly running a harmful file.

Are there compatibility issues?

The skill says the header has no known compatibility problems and takes minutes to set up.

How can I check that it works?

The skill suggests checking the response headers with a curl request.

Details

Original description by the author

Use when auditing HTTP response headers on any web server or CDN for security hardening.

repo: thedaviddias/Front-End-Checklist

Popularity

GitHub stars
75k
Ranking position
#3090
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills