x-content-type
できること
このスキルは、ウェブサーバーがnosniffのヘッダーを送っているかを確認します。ウェブサイトを一般的な攻撃から守る開発者やIT担当者向けです。
使う場面
- ✓サーバーの応答にX-Content-Type-Optionsヘッダーが含まれていないとき。
- ✓セキュリティのチェックリストでヘッダーの強化が求められているとき。
- ✓ファイルがアップロードされ、その後訪問者に配信されているとき。
スキルのリンク
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちのセキュリティスキャンでX-Content-Type-Optionsヘッダーが不足していると出ています。追加してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、すべての応答に対して、サーバーまたはフレームワークの設定にヘッダーを追加します。その後、応答のヘッダーを確認して、ヘッダーがあることを確かめます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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: nosniffon all responses — the only valid value isnosniff - 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-Typeheaders 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
よくある質問
nosniffは何をしますか?
ブラウザーにファイルの種類を推測せず、宣言された種類を信頼するよう伝え、危険なファイルを実行するのを防ぎます。
互換性の問題はありますか?
このスキルによると、このヘッダーには既知の互換性の問題がなく、設定は数分で済みます。
動作はどう確認できますか?
このスキルは、curlのリクエストで応答のヘッダーを確認することを勧めています。
詳細
作者による元の説明
Use when auditing HTTP response headers on any web server or CDN for security hardening.
人気
- GitHubのスター
- 75k
- ランキング
- #3090
- ライセンス
- MIT
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
frontendchecklist
75kコマンドラインツールを使って、フロントエンドのコードとライブページを、アクセシビリティ、速度、SEO、セキュリティに関する380以上のルールと照らし合わせて確認します。
frontend-checklist-global
75kフロントエンドのプロジェクトを、386のFront-End Checklistのルールすべてと照らし合わせて監査し、見つかった問題ごとに具体的な修正方法を示します。
404-page
75k見つからないページの画面に役立つリンクがあり、本物の404ステータスを返すかを確認し、迷った訪問者が目的のページを見つけられるようにします。
about-page
75kサイトの運営者が誰かを説明する、分かりやすいAboutページがあるかを確認し、訪問者と検索エンジンからの信頼を高めます。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。