When a browser follows a link or loads an image, script, font or iframe, it can tell the receiving server where the request came from. That information travels in the Referer request header, and the destination page can also read it in JavaScript as document.referrer. It is useful for analytics and for a few security checks, but it can also carry far more than you meant to share: the full path of the page, its query string, and whatever your application put into that query string.
The Referrer-Policy response header lets you decide how much of that address the browser sends, and to whom. Modern browsers already apply a reasonably safe default when the header is missing, which is why a missing header is a low-severity finding rather than an emergency. Setting it explicitly still matters: it removes the dependency on browser defaults, it lets you go stricter on sensitive pages, and it documents a decision instead of leaving it to chance.
This guide explains what the Referer header can leak, how browser defaults work today, how the eight policy values differ, why strict-origin-when-cross-origin is the sensible baseline for most sites, what changes in analytics and integrations when you go stricter, and how to configure and verify the header on common stacks. All examples use example.com.
Scope of this guide
This guide covers the Referrer-Policy header and the Referer values browsers send from your own pages. Automated checks read public response headers only; they cannot see tokens in your URLs, per-link attributes or which third parties receive your traffic.
1. What the Referer header carries
The Referer header (the misspelling dates back to the early HTTP specifications and is kept in RFC 9110) contains the address of the page or resource that caused the request. The response header that controls it, Referrer-Policy, uses the correct spelling. Keep both spellings in mind when you search logs or configuration files.
Browsers send a referrer in two broad situations:
- Navigations. A visitor clicks a link on
https://example.com/account/orders?id=4821to a partner site. The partner’s server may receive that address inReferer, and scripts on the partner page can read it fromdocument.referrer. - Subresource requests. Your page loads an analytics script, a web font, a chat widget, a map or an embedded video. Each of those requests can carry the address of your page to the third party that hosts it, even if the visitor never clicks anything.
A few parts of a URL are never sent. According to the W3C Referrer Policy specification, browsers strip the fragment (everything after #) and any username and password embedded in the URL before using it as a referrer. Everything else, including the path and the query string, can be sent unless a policy says otherwise.
2. What can leak: tokens, internal paths and search terms
The risk is rarely the domain name. It is what applications put into paths and query strings. Typical examples from real-world sites:
- Secrets in URLs. Password reset links such as
/reset?token=…, magic sign-in links, invitation codes, unsubscribe links with a user identifier, or shared document links that work for anyone holding the URL. If the reset page loads a third-party script or the visitor clicks an outbound link, the token can reach that third party. The OWASP Forgot Password Cheat Sheet calls out this referrer leakage and recommends ano-referrerpolicy on reset pages. - Internal structure. Paths like
/admin/users/4821/edit,/internal/reports/q3-forecastor a staging hostname reveal how your application is organised, which customer or record a person was viewing, and which tools you run. - Personal data and intent. Search pages such as
/search?q=…, filter parameters, email addresses passed in query strings by marketing tools, or health and finance topics in the path tell a third party what a specific visitor was looking at.
Referrer-Policy limits one channel. The same URLs also end up in browser history, server and proxy logs, analytics reports and screenshots. The durable fix is to keep secrets out of URLs: send sensitive values in POST bodies or headers, make one-time tokens short-lived and single-use, and exchange a token from the URL for a session as soon as the page loads, then redirect to a clean address. A strict referrer policy is the second layer, not the first.
3. Browser defaults, and why a missing header is rated low
For many years browsers defaulted to no-referrer-when-downgrade: the full URL went to every HTTPS destination, and nothing was sent only when moving from HTTPS to plain HTTP. That default is what made referrer leaks common.
The specification now defines strict-origin-when-cross-origin as the default. According to web.dev, Chrome switched to it in version 85 and Firefox in version 87, and Safari applies its own comparably strict rules. Under this default, other origins receive only https://example.com/, your own origin still receives the full URL, and HTTPS-to-HTTP requests receive nothing.
So why set the header at all?
- Not every client is current. Older browsers, embedded webviews in apps and some specialised clients may still use the old default.
- You may need something stricter. Account pages, reset flows and admin areas often deserve
same-originorno-referrer, and the default will never choose that for you. - Explicit beats implicit. A header in your configuration records the decision, survives browser changes and makes reviews and audits straightforward. The OWASP HTTP Headers Cheat Sheet recommends setting
Referrer-Policy: strict-origin-when-cross-origin.
Because current browsers already behave safely without it, a missing Referrer-Policy is a hardening gap rather than an open hole. That is why it is rated low, not medium or high.
4. The eight policy values compared
The table shows what each value sends from the page https://example.com/account/orders?id=4821 in three situations: a request to your own origin, a request to another HTTPS origin, and a request to a plain HTTP address (a downgrade).
| Policy | Same origin | Other HTTPS origin | HTTPS to HTTP |
|---|---|---|---|
no-referrer | Nothing | Nothing | Nothing |
same-origin | Full URL | Nothing | Nothing |
strict-origin | https://example.com/ | https://example.com/ | Nothing |
strict-origin-when-cross-origin | Full URL | https://example.com/ | Nothing |
origin | https://example.com/ | https://example.com/ | https://example.com/ |
origin-when-cross-origin | Full URL | https://example.com/ | https://example.com/ |
no-referrer-when-downgrade | Full URL | Full URL | Nothing |
unsafe-url | Full URL | Full URL | Full URL |
“Full URL” means scheme, host, path and query string, without the fragment or credentials. Note that http://example.com is a different origin from https://example.com, so a downgrade is always cross-origin. The values are ordered here from most to least restrictive; the MDN reference has the same comparison with browser support notes. The last two rows reproduce the old leaky behaviour and should not be used as a site-wide policy.
5. Choosing a policy: strict-origin-when-cross-origin or stricter
For most sites, a two-level approach works well:
- Site-wide baseline:
strict-origin-when-cross-origin. Your own analytics and same-origin features keep the full URL, partners and third parties learn only that the visit came from your site, and nothing is sent over unencrypted connections. It matches the modern browser default, so it rarely breaks anything. - Sensitive areas:
same-originorno-referrer. Password reset, sign-in, account, checkout and admin pages can send the header with a stricter value.same-originkeeps internal referrers for your own tools and CSRF checks;no-referrersends nothing at all.
Choose strict-origin if you do not want even your own origin to see full paths, for example because internal pages are logged by a separate service on the same origin. Choose no-referrer site-wide only if you have checked the integrations in the next section, because it removes the origin that some services rely on.
A short decision guide:
- Marketing site, blog or shop with partners and referral programmes:
strict-origin-when-cross-origin. - SaaS application with account data in URLs:
strict-origin-when-cross-originon public pages,same-origininside the app. - Pages that receive secrets in the URL:
no-referrer, plus no third-party resources on that page. - Intranet or admin hosts:
same-originorno-referrer.
6. Side effects on analytics and integrations
Your policy controls what you send, not what you receive. Inbound referral data in your analytics depends on the policy of the site that links to you, so changing your header does not change how other sites appear in your reports.
What does change:
- Your outbound traffic in partners’ reports. With
strict-origin-when-cross-origin, partners seehttps://example.com/instead of the exact page. Withsame-originorno-referrer, your visits show up as direct traffic in their tools. For links you control, campaign parameters such asutm_sourcegive partners attribution without exposing the originating path. - Internal navigation data. Same-origin referrers are unaffected by
strict-origin-when-cross-originandsame-origin. Withstrict-originorno-referrer, your own analytics may lose the previous page in a visitor’s path. - Services that allow-list by referrer. Some browser-side API keys, such as those restricted by HTTP referrer in Google Maps Platform, embedded players with domain restrictions and hotlink protection on image hosts check the referring origin. Policies that send the origin keep working;
no-referrerandsame-origincan make those requests fail. - CSRF checks. Some frameworks compare the Referer or Origin header on HTTPS form submissions. Same-origin requests still carry the full URL under
strict-origin-when-cross-originandsame-origin;no-referrercan break those checks. Django, for example, sendssame-originby default through itsSECURE_REFERRER_POLICYsetting. - Affiliate and payment flows. A few partner programmes or payment pages check the referring domain. Read their documentation before going stricter than origin-level.
For a wider review of third-party scripts and the data they receive, see the integrations audit guide.
7. Configuring the header on common stacks
Set the header once, at the layer that owns your response headers, and make sure it is sent on error pages and redirects as well.
nginx
server {
listen 443 ssl;
server_name example.com;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
}The always parameter adds the header to error responses too. An add_header inside a location block replaces all server-level add_header lines for that location, so repeat the line there if you add other headers (nginx headers module).
Apache (mod_headers)
<IfModule mod_headers.c>
Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>Caddy
example.com {
header Referrer-Policy "strict-origin-when-cross-origin"
}Node.js with Express and Helmet
Helmet sends no-referrer by default. If that breaks an integration, set the value explicitly:
app.use(helmet({
referrerPolicy: { policy: "strict-origin-when-cross-origin" }
}));Next.js
module.exports = {
async headers() {
return [{
source: "/:path*",
headers: [{ key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }]
}];
}
};Netlify (_headers file)
/*
Referrer-Policy: strict-origin-when-cross-origin
/reset/*
Referrer-Policy: no-referrerDjango
SECURE_REFERRER_POLICY = "strict-origin-when-cross-origin"On a CDN, use its response header rules instead, but decide whether the CDN or the origin owns the header so that you do not end up with two different values.
8. Per-page and per-link control, and edge cases
The header is not the only way to set a policy. Browsers also honour finer-grained settings, documented on MDN:
- Meta tag:
<meta name="referrer" content="no-referrer">in the document head sets the policy for that page. It is useful on static hosts where you cannot set headers, but header-based scanners do not see it. - Element attribute:
referrerpolicy="no-referrer"ona,area,img,iframe,scriptandlinkelements overrides the page policy for that one request. - Link relation:
rel="noreferrer"on a link sends no referrer for that navigation and also impliesnoopener. - Fetch:
fetch(url, { referrerPolicy: "no-referrer" })sets it for one request from JavaScript.
Edge cases worth knowing:
- Fallback lists. The header can contain several comma-separated values, and the browser uses the last one it recognises.
Referrer-Policy: no-referrer, strict-origin-when-cross-origingives older browsersno-referrerand modern ones the second value. This is also why a CDN and an origin that each add a different value can produce surprising results: the browser sees one combined list and the last valid token wins. - Redirects. Under the Fetch rules, a Referrer-Policy header on a redirect response updates the policy for the follow-up request, so send the header on redirects too.
- Subresources. A stylesheet served with its own Referrer-Policy controls the referrer for requests that stylesheet makes, such as fonts and background images.
- Typos. An unrecognised value is ignored, which quietly leaves the browser default in place. Copy the value exactly.
9. How to verify the fix
Start with the response headers. From a terminal:
curl -sS -D - -o /dev/null https://example.com/ | grep -i '^referrer-policy'
curl -sS -D - -o /dev/null https://example.com/this-page-does-not-exist | grep -i '^referrer-policy'
curl -sS -D - -o /dev/null http://example.com/ | grep -i '^referrer-policy'You should see exactly one referrer-policy line with the intended value on the home page, on an error page and, ideally, on the redirect. Repeat for sensitive paths such as your reset or account pages to confirm the stricter value. On Windows, call curl.exe, use -o NUL and replace grep -i with findstr /i.
Then check the behaviour in a browser:
- Open DevTools, go to the Network panel and reload a page that loads third-party resources.
- Select a request to another domain. In Chrome, the General block of the Headers tab shows the effective Referrer Policy, and the request headers show the
Referervalue actually sent. Withstrict-origin-when-cross-origin, it should readhttps://example.com/with no path. - On a page that should send nothing, confirm that third-party requests carry no
Refererheader at all. - Click an outbound link to a page you control on another domain and run
document.referrerin its console to see what the destination received.
Finally, compare your analytics and any referrer-restricted integrations for a few days after the change to catch side effects early.
10. What Sitelemetry checks
The finding http.header.referrer-policy.missing comes from Sitelemetry’s HTTP security headers module. The module requests the home page (root URL) of the scanned origin, follows redirects, reads the response headers of the final page and raises this finding, rated low, when no Referrer-Policy header is present. The evidence reads “Referrer-Policy not present”, and the remediation recommends strict-origin-when-cross-origin or a more restrictive policy as needed. The same module also reports related header gaps, such as a missing Content-Security-Policy, missing clickjacking protection, a missing X-Content-Type-Options: nosniff and server technology disclosure.
Know its limits. It reads only the home page response, and it is a presence check: it does not grade the value, so a header set to unsafe-url does not raise this finding, and it does not read <meta name="referrer"> tags, referrerpolicy attributes or tokens in your URLs. Use the verification steps above for those.
The module is passive and runs in every scan profile on every plan: Free ($0), Starter ($49/month), Professional ($149/month) and Enterprise ($249/month). It reads only what any visitor receives, so it needs no ownership verification on its own: it is one of the eight passive checks in the free Launch Readiness Snapshot, which runs without signup, and a Free-plan security audit runs it even before you verify the site. A security audit that also includes checks that need ownership proof, as paid-plan audits do by default, asks you to verify the site first. If the response is a bot challenge, an access denial or an edge error page, the module reports the result as not measured instead of raising header findings. You can also open the header results directly with the free security headers checker. Sitelemetry is an automated audit tool, not a penetration test. For the headers that usually travel with this one, read the security headers check guide, the TLS and security headers guide and the broader website security audit guide; plan details are on the pricing page.
Common questions
What is the best Referrer-Policy value?
For most sites, strict-origin-when-cross-origin. It keeps full referrers on your own origin, sends only your origin to other sites and sends nothing over plain HTTP. Use same-origin or no-referrer on pages with sensitive URLs, such as password reset, account or admin pages.
Do I need a Referrer-Policy header if browsers already default to strict-origin-when-cross-origin?
It is still worth setting. Current Chrome, Firefox and Safari behave safely without it, but older browsers and some embedded webviews may not, and the default never chooses a stricter policy for sensitive pages. An explicit header also documents your decision and survives future browser changes.
Will a stricter referrer policy hurt my analytics?
Your own analytics are unaffected by strict-origin-when-cross-origin or same-origin, because same-origin requests keep the full URL. What changes is what partners see: only your origin, or nothing with no-referrer. Inbound referral data depends on the linking site's policy, not yours. Use campaign parameters on links you control for attribution.
Is it Referer or Referrer?
Both, for historical reasons. The request header is spelled Referer, a misspelling kept since the early HTTP specifications. The response header that controls it, the meta tag name and the HTML attribute use the correct spelling: Referrer-Policy, name="referrer" and referrerpolicy.
Does a referrer meta tag satisfy Sitelemetry's check?
No. The check looks for a Referrer-Policy response header. A meta tag still works in browsers for that page, but header-based checks do not see it. Setting the header at the server or CDN covers every page, including those that do not render your HTML template.
Sources & further reading
- W3C Referrer Policywww.w3.org
- MDN: Referrer-Policy headerdeveloper.mozilla.org
- MDN: Referer headerdeveloper.mozilla.org
- web.dev: Referer and Referrer-Policy best practicesweb.dev
- OWASP HTTP Security Response Headers Cheat Sheetcheatsheetseries.owasp.org
- OWASP Forgot Password Cheat Sheetcheatsheetseries.owasp.org
- RFC 9110: HTTP Semanticswww.rfc-editor.org
- nginx: ngx_http_headers_module (add_header)nginx.org
Prepared by the Sitelemetry editorial team. Explore the linked sources for further detail.



