Pular para o conteúdo
Skillpedia
Segurança75 mil · #3090

x-content-type

O que ela faz

Esta skill verifica se o servidor web envia o cabeçalho de segurança nosniff. Ela é para desenvolvedores e equipes de TI que reforçam sites contra ataques comuns.

Quando usar

  • ✓Quando as respostas de um servidor não incluem o cabeçalho X-Content-Type-Options.
  • ✓Quando uma lista de segurança pede o reforço de cabeçalhos.
  • ✓Quando arquivos são enviados e depois servidos de volta aos visitantes.

Link da skill

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

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Nosso scan de segurança diz que estamos sem o cabeçalho X-Content-Type-Options. Você pode adicioná-lo?”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente adiciona o cabeçalho na configuração do servidor ou do framework, para todas as respostas. Depois verifica os cabeçalhos de resposta para confirmar que ele está presente.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do 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

Perguntas frequentes

O que o nosniff faz?

Ele diz aos navegadores para confiar no tipo de arquivo declarado, em vez de adivinhá-lo e possivelmente executar um arquivo nocivo.

Há problemas de compatibilidade?

A skill diz que o cabeçalho não tem problemas de compatibilidade conhecidos e leva minutos para configurar.

Como posso testar se funciona?

A skill sugere verificar os cabeçalhos de resposta com uma requisição curl.

Detalhes

Descrição original do autor

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

repo: thedaviddias/Front-End-Checklist

Popularidade

Estrelas no GitHub
75 mil
Posição no ranking
#3090
Licença
MIT
Atualizada em
31/10/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas