Home / Core Health / Set Referrer-Policy header to control data leakage
Security Headers · Scan Check Guide

Set Referrer-Policy header to control data leakage

10 min Impact: medium Effort: low ✓ Scan-verified — no manual checkbox

Referrer-Policy controls how much information about the page a visitor is leaving gets sent to the NEXT site they click through to — without it, the full URL of your page (which can include sensitive query parameters like session tokens or search terms) can leak to every external link a visitor clicks.

Without this header, your full URL (including query parameters and tokens) is sent to every external site visitors click to. This can leak session data, user IDs, or sensitive paths.

The full picture

The Referrer-Policy header controls a genuine, often-overlooked information leakage vector — by default, when a visitor navigates from your site to another, their browser typically sends the full URL of the page they came from, including any potentially sensitive information embedded in that URL, to the destination site.

This leakage becomes a genuine privacy and security concern specifically when your URLs contain sensitive parameters — session identifiers, search queries revealing personal information, or other data you wouldn't want transmitted to third-party sites your visitors subsequently navigate to, all potentially exposed through this default referrer-sharing behavior.

A well-configured Referrer-Policy — commonly "strict-origin-when-cross-origin" as a genuinely balanced default — limits what information gets shared with destination sites based on the security context of the navigation, sending fuller referrer information for same-site navigation while restricting it for cross-site navigation, particularly when moving from a secure HTTPS page to a potentially less secure destination.

This header represents a genuine, meaningful privacy protection for your visitors with essentially no functional downside for legitimate use cases — the modest implementation effort required is disproportionate to the real information-leakage risk this single header configuration closes off.

How to fix it

  1. 1
    Pick a policy level
    strict-origin-when-cross-origin is the modern, sensible default — full URL sent to your own domain, only the origin (no path) sent to other sites, nothing sent on an HTTPS-to-HTTP downgrade.
  2. 2
    Add the header
    Set Referrer-Policy: strict-origin-when-cross-origin in your server config or CDN.
  3. 3
    Check any analytics that rely on referrer data
    If you specifically need full-URL referrer data for attribution, confirm your analytics tool doesn't depend on more than the origin being passed.

Common mistakes

How you'll know it's done

The response header Referrer-Policy: strict-origin-when-cross-origin (or similarly restrictive) is present.

Tools that help

H.I.V.E. checks this automatically

Fix it, then re-scan — the check confirms itself. No manual checkbox, the scan is the truth.

Run this check in H.I.V.E. →