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

referrer-policy

できること

このスキルは、サイトが送るヘッダーを確認し、他のサイトに共有されるアドレス情報を制限するReferrer-Policyを設定します。ログインやセッションを扱うアプリで、重要なリンクやトークンを守りたい開発者向けです。

使う場面

  • ✓ウェブサイトのセキュリティヘッダーを確認するようエージェントに頼むとき。
  • ✓ページのアドレスに非公開のトークンやIDが含まれていて、それが漏れないようにしたいとき。
  • ✓ログインやセッションを扱うアプリを強化しているとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/referrer-policy/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

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

AIへの頼み方の例

“私のパスワード再設定のリンクにはトークンが含まれています。リンクをクリックされても、そのトークンが他のサイトに漏れないようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、Referrer-Policyヘッダーが送られているかを確認し、推奨の既定値であるstrict-origin-when-cross-originに設定します。特に機密性の高いアドレスのページには、より厳しい設定を提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Set a Referrer-Policy header

Without a Referrer-Policy, a password reset link like https://example.com/reset?token=abc123 is included in the Referer header when the user clicks an external link on that page — leaking the token to third parties.

Quick Reference

  • Use Referrer-Policy: strict-origin-when-cross-origin — the recommended modern default
  • strict-origin-when-cross-origin sends the full URL for same-origin requests, only the origin for cross-origin HTTPS, and nothing for HTTPS→HTTP
  • Never use unsafe-url — it sends the full URL including path and query string to every external site
  • Can be set via HTTP header, <meta> tag, or the referrerpolicy attribute on individual <a> and <img> elements
  • Sensitive URLs (reset tokens, private IDs) in query strings can be exposed via the Referer header if policy is too permissive

Check

Check whether the server sends a Referrer-Policy header and verify the value is appropriate. The recommended value is strict-origin-when-cross-origin. Check for any pages with sensitive URL parameters that could be leaked via the Referer header.

Fix

Add Referrer-Policy: strict-origin-when-cross-origin to all HTTP responses. Configure it in your web server, CDN, or application framework. For pages with particularly sensitive URLs, consider no-referrer or same-origin.

Explain

Explain what the Referer header contains, how a permissive Referrer-Policy can leak sensitive URL parameters to third parties, and what the difference is between the various Referrer-Policy values.

Code Review

Review server config, headers, forms, and integration points related to Set a Referrer-Policy header. 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/referrer-policy

よくある質問

strict-origin-when-cross-originは何をしますか?

自分のサイトには完全なアドレスを送り、他のHTTPSのサイトにはサイト名だけを送り、HTTPSからHTTPへ移るときには何も送りません。

unsafe-urlを避けるべきなのはなぜですか?

このスキルによると、パスやクエリを含む完全なアドレスを、すべての外部サイトに送ってしまうからです。

ポリシーは他のどこに設定できますか?

このスキルによると、metaタグや、個々のリンクや画像にも設定できます。

詳細

作者による元の説明

Use when reviewing HTTP response headers for privacy hardening on any website that handles authentication, session state, or sensitive URL parameters.

repo: thedaviddias/Front-End-Checklist

人気

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

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

0

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

コメント

  • …

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

似ているスキル