Skip to content
Skillpedia
Security75k · #2993

referrer-policy

What it does

This skill checks the headers a site sends and sets a Referrer-Policy that limits what address information is shared with other sites. It is for developers who want to protect sensitive links and tokens.

When to use it

  • ✓When you ask the agent to review the security headers of a website.
  • ✓When your pages include private tokens or IDs in the address and you want to stop them leaking.
  • ✓When you are hardening an app that handles logins or sessions.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/referrer-policy/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“My password reset links have tokens in them. Can you make sure those tokens cannot leak to other sites when someone clicks a link?”

5 new skills a week. 1 minute to read.

How it works

The agent checks whether a Referrer-Policy header is sent and sets it to strict-origin-when-cross-origin, a recommended default. For pages with especially sensitive addresses, it suggests a stricter setting.

Technical content (original SKILL.md)

Original text by the author, straight from 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

FAQ

What does strict-origin-when-cross-origin do?

It sends the full address to your own site, only the site name to other HTTPS sites, and nothing when moving from HTTPS to HTTP.

Why should unsafe-url be avoided?

The skill says it sends the full address, including path and query, to every external site.

Where else can the policy be set?

The skill says it can also be set with a meta tag or on individual links and images.

Details

Original description by the author

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

Popularity

GitHub stars
75k
Ranking position
#2993
License
MIT
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills