Referrer-Policy (Referrer-Policy)

Security Glossary - Security Headers

Definition: Referrer-Policy controls how much referrer information (the URL of the previous page) the browser includes when navigating from your site to another. The Referer header can leak sensitive information like search queries, user IDs in URLs, or internal page paths to third-party sites.

Quick Reference

Policy ValueSends Referrer?When?
no-referrerNever-
same-originSame origin onlySame-origin requests
strict-originOrigin onlyHTTPS to HTTPS
strict-origin-when-cross-originFull URL same-origin, origin cross-originRecommended default
no-referrer-when-downgradeFull URL except HTTPS to HTTPBrowser default

Why Referrer-Policy Matters

The HTTP Referer header is sent by default with most navigation and resource requests. If your site has URLs like example.com/dashboard/user/12345, the full URL is sent to any external link the user clicks or any third-party resource loaded on the page. This leaks internal URL structures and potentially user-specific information.

Setting Referrer-Policy: strict-origin-when-cross-origin (the recommended value) sends only the origin (example.com) when navigating to other sites, not the full URL path. This preserves referrer information for your own analytics (same-origin requests still get the full referrer) while preventing information leakage to third parties.

For sites handling sensitive data, Referrer-Policy: no-referrer or Referrer-Policy: same-origin provides the strictest control by sending no referrer to external sites at all. The tradeoff is that external sites cannot see where their traffic comes from, which may affect analytics or affiliate tracking.

How to Test for Referrer-Policy

A security audit checks the Referrer-Policy header. The recommended value is "strict-origin-when-cross-origin" or "no-referrer" for sensitive applications. Verify that your policy does not leak sensitive URL paths to third-party sites.

See how your site handles Referrer-Policy

Run a Security Audit

Frequently Asked Questions

What is the best Referrer-Policy value?
For most sites: strict-origin-when-cross-origin. This sends the full referrer for same-origin requests (your own analytics) and only the origin for cross-origin requests (no URL paths leaked to external sites). For sensitive apps, use no-referrer.
Does Referrer-Policy affect analytics?
Same-origin referrers are still sent with most policies, so your own analytics tools get full referrer data. Cross-origin analytics services may receive only the origin or no referrer, depending on the policy. strict-origin-when-cross-origin is a good balance.
Disclaimer: DomainOptic provides automated informational scans only. Results do not constitute professional security advice, compliance certification, or a guarantee of security. Always verify findings independently.