Langsung ke konten
Skillpedia
Keamanan75k · #3090

x-content-type

Fungsinya

Skill ini memeriksa apakah server web mengirimkan header keamanan nosniff. Skill ini ditujukan untuk pengembang dan staf TI yang memperkuat situs web terhadap serangan umum.

Kapan dipakai

  • ✓Saat respons server tidak menyertakan header X-Content-Type-Options.
  • ✓Saat daftar periksa keamanan meminta pengerasan header.
  • ✓Saat file diunggah lalu disajikan kembali kepada pengunjung.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Pemindaian keamanan kami mengatakan kami kehilangan header X-Content-Type-Options. Bisakah Anda menambahkannya?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menambahkan header ke konfigurasi server atau framework untuk semua respons. Lalu agent memeriksa header respons untuk memastikan header tersebut ada.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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

Pertanyaan umum

Apa yang dilakukan nosniff?

Itu meminta peramban untuk memercayai jenis file yang dinyatakan, alih-alih menebaknya dan mungkin menjalankan file berbahaya.

Apakah ada masalah kompatibilitas?

Skill menyatakan header ini tidak memiliki masalah kompatibilitas yang diketahui dan membutuhkan waktu beberapa menit untuk diatur.

Bagaimana saya memeriksa bahwa ini berfungsi?

Skill menyarankan memeriksa header respons dengan permintaan curl.

Detail

Deskripsi asli dari pembuat

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

repo: thedaviddias/Front-End-Checklist

Popularitas

Bintang GitHub
75k
Peringkat
#3090
Lisensi
MIT
Diperbarui
31/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa