本文へスキップ
Skillpedia
セキュリティ75k · #3090

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/x-content-type/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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: 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

よくある質問

nosniffは何をしますか?

ブラウザーにファイルの種類を推測せず、宣言された種類を信頼するよう伝え、危険なファイルを実行するのを防ぎます。

互換性の問題はありますか?

このスキルによると、このヘッダーには既知の互換性の問題がなく、設定は数分で済みます。

動作はどう確認できますか?

このスキルは、curlのリクエストで応答のヘッダーを確認することを勧めています。

詳細

作者による元の説明

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

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#3090
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル