Referrer-Policyis an HTTP response header that controls how much of the current page's URL the browser sends in theRefererheader of the requests and navigations that page makes.- Use
strict-origin-when-cross-origin: the full URL stays on your own origin, other HTTPS sites get onlyhttps://example.com/, and HTTP sites get nothing. - It is already the browser default, but send it anyway. It states your intent, covers older browsers, and is what WebSec0 and other scanners check.
- Use
no-referrerorsame-originfor pages whose URLs carry secrets, such as password reset links. Avoidunsafe-urlandno-referrer-when-downgrade, which send full URLs to other sites. - With several values or several headers, browsers apply the last one they recognise, and so does WebSec0. It gives the full 15 points to any valid policy except
unsafe-urlandno-referrer-when-downgrade, which earn 7.
What is Referrer-Policy?
Referrer-Policy is an HTTP response header that controls how much of the
current page’s URL the browser sends in the Referer header. Every time a
page loads an image, a script or a font, calls an API, or the user follows a
link, the browser can tell the destination which page the request came from.
The policy decides whether that is the full URL, the origin only, or nothing.
The value most sites should send is:
Referrer-Policy: strict-origin-when-cross-originRequests to your own origin keep the full URL. Other HTTPS sites receive only
https://example.com/. Plain HTTP sites receive no Referer at all.
It is also the browser default: Chrome switched to it in version 85, in August 2020, and Firefox in version 87, in March 2021. Sending it explicitly still matters for older browsers and for scanners. Adoption has grown fast: in Scott Helme’s June 2026 crawl, 229,130 of the 819,002 top sites that responded sent the header (about 28%), more than three times the 2022 figure.
What the Referer header leaks
The Referer header carries the URL of the page that made the request, path
and query string included. Anything in that URL can reach the site on the
other end:
| What is in your URLs | Who can receive it |
|---|---|
| Password reset, invitation or magic login tokens | Every third-party script, image, font or link on the page |
Search terms, filters and form values sent by GET |
Analytics, ad and social widgets |
User or order identifiers, such as /account/42/invoices |
External sites your users click through to |
Internal host names and paths, such as intranet.example.com/hr/ |
CDNs and embedded services |
A typical leak looks like this. A user on a reset page clicks a link to your help centre, hosted by a third party:
GET /articles/reset-help HTTP/2
Host: help.vendor.example
Referer: https://example.com/reset?token=9f2c4e1aWith strict-origin-when-cross-origin, the same request carries
Referer: https://example.com/ and the token stays on your site. The real fix
is to keep secrets out of URLs, but the policy limits the damage when they are
there.
The eight values
The specification defines eight values. The table shows what each one sends,
from a page at https://example.com/page?id=7:
| Value | To your own origin | To another HTTPS site | To an HTTP site | WebSec0 |
|---|---|---|---|---|
no-referrer |
Nothing | Nothing | Nothing | Pass |
same-origin |
Full URL | Nothing | Nothing | Pass |
strict-origin |
Origin | Origin | Nothing | Pass |
strict-origin-when-cross-origin |
Full URL | Origin | Nothing | Pass |
origin |
Origin | Origin | Origin | Pass |
origin-when-cross-origin |
Full URL | Origin | Origin | Pass |
no-referrer-when-downgrade |
Full URL | Full URL | Nothing | Warning |
unsafe-url |
Full URL | Full URL | Full URL | Warning |
“Origin” means the scheme, host and port only: https://example.com/. The
strict- values never send anything from HTTPS to HTTP. The other two
origin-only values send the origin in clear text to HTTP sites. The
Strict-Transport-Security header does
not help there: it only upgrades requests to your own hosts.
Which value should you choose?
| Your site | Value |
|---|---|
| Most sites | strict-origin-when-cross-origin |
| Pages with tokens or personal data in URLs, such as reset or account pages | no-referrer or same-origin on those pages |
| An application that must not reveal which site users came from | no-referrer for the whole site |
| A partner or affiliate that needs the full referring URL | A referrerpolicy attribute on those links only, not a weaker site-wide policy |
no-referrer is the most private, but it removes the referrer on your own
requests too. That breaks server-side checks that compare the Referer with
your origin, hotlink protection based on it, and some payment or embed
providers that check where a request comes from. same-origin keeps the full
URL for your own requests and sends nothing elsewhere, which avoids most of
those problems.
Policies in HTML and per link
The header sets the policy for a whole response. HTML can override it:
- A
<meta>tag sets the policy for the page:<meta name="referrer" content="no-referrer">. It overrides the header. In our test in Chrome 152, a page sendingReferrer-Policy: no-referrerwith a<meta name="referrer" content="unsafe-url">sent its full URL to another origin. - The
referrerpolicyattribute sets it for one element:<a>,<area>,<img>,<iframe>,<script>and<link>. rel="noreferrer"on a link sends no referrer for that navigation.
<a href="https://partner.example/" referrerpolicy="origin">Partner</a>
<a href="https://other.example/" rel="noreferrer">Other site</a>Check that your templates do not contain a weaker <meta name="referrer">
than the header. Scanners that read headers will not see it.
Several values and fallbacks
The header accepts a comma-separated list, and a response can carry several
Referrer-Policy headers. Browsers read every value in order, skip the ones
they do not know, and apply the last one they recognise. This was designed
so sites could list a fallback first and a newer value last:
Referrer-Policy: no-referrer, strict-origin-when-cross-originIt also means a weaker value added later wins. What we saw in Chrome 152, from a page on another origin:
| Headers sent | Referer sent cross-origin |
|---|---|
no-referrer, unsafe-url |
Full URL |
strict-origin-when-cross-origin, then a second header unsafe-url |
Full URL |
unsafe-url, made-up-policy |
Full URL: the unknown value is skipped |
made-up-policy alone |
Origin only: the browser default applies |
"unsafe-url" with quotes |
Origin only: quoted values are invalid |
Today every browser supports strict-origin-when-cross-origin, so a single
value is enough. Send one header with one value.
Where to send the header
- On every HTML response, including error pages. The policy applies to everything the page loads and to the links users follow from it.
- On CSS files too. Requests made by a stylesheet, for fonts and background images, use the stylesheet’s own policy. Sending the header on every response is the simplest way to cover them.
- On redirects. A
Referrer-Policyon a redirect response replaces the policy for the next hop. - Once per response. Duplicates usually come from the application and the web server both adding the header. Browsers apply the last one, which may be the weaker.
Check what a page sends with curl:
curl -sI https://example.com/ | grep -i "^referrer-policy"Common mistakes
- Setting
unsafe-urlto “fix” analytics. It sends full URLs, including tokens, to every site and over plain HTTP. Your own analytics already gets full URLs on your origin. - Copying
no-referrer-when-downgradefrom an old guide. It was the default before 2020 and leaks full URLs to every HTTPS site. - Spelling the header
Referer-Policy. Browsers ignore it. Only the request header has the single r. - Quoting the value.
Referrer-Policy: "no-referrer"is invalid and the browser default applies. - Two headers with different values. The last one wins, whatever the order of your configuration files.
- A weaker
<meta name="referrer">in the page. It overrides the header. - Relying on
Refererfor security checks. It can be removed by the browser, an extension or your own policy. Use CSRF tokens and theOriginheader. - Putting secrets in URLs. Referrer-Policy limits one leak; URLs also end
up in logs, history and shared links. Move tokens to
POSTbodies or cookies where you can.
How WebSec0 grades Referrer-Policy
Referrer-Policy is worth 15 of the 100 points in the WebSec0 headers grade.
The scanner fetches your page and works out the policy a browser would apply:
the last recognised value across every Referrer-Policy header and
comma-separated list, in any case.
| Policy a browser would apply | Status | Points |
|---|---|---|
No Referrer-Policy header |
Fail | 0 / 15 |
| A header with no recognised value, such as a typo or a quoted value | Fail | 0 / 15 |
unsafe-url or no-referrer-when-downgrade |
Warning | 7 / 15 |
| Any of the other six values | Pass | 15 / 15 |
A few details follow from how the check works:
- The last value counts.
no-referrer, unsafe-urlis a warning, and so is a second header that ends inunsafe-url. - An unrecognised value scores like no header, because browsers ignore it and keep their default.
originandorigin-when-cross-originpass, although they send your origin over plain HTTP. Prefer thestrict-values.<meta name="referrer">tags are not read. The grade reflects the headers only.
Step by step
Configure it on your server
Apache
Guide ↗Set Referrer-Policy on Apache with Header always set, keep it on errors and redirects, use no-referrer on sensitive paths and stop a proxied app's value winning. Tested.
Caddy
Guide ↗Set Referrer-Policy on Caddy with the header directive, use no-referrer on sensitive paths with route, and stop a proxied app's weaker value from winning. Tested configs.
Nginx
Guide ↗Set Referrer-Policy on Nginx with add_header and always, keep it on every location, use a stricter policy on sensitive paths and avoid duplicate headers. Tested configs.
Traefik
Guide ↗Set Referrer-Policy on Traefik with the referrerPolicy option of the headers middleware, in labels or a file, and use no-referrer on sensitive paths. Tested configs.
Setting up every header at once? Read all security headers on Apache, all security headers on Caddy, all security headers on Nginx, all security headers on Traefik.
Questions
Frequently asked questions
What does the Referrer-Policy header do?
It tells the browser how much of your page's URL to put in the Referer header when that page loads a resource or the user follows a link: the full URL, the origin only, or nothing. It applies to requests to your own site and to other sites.
What is the best Referrer-Policy value?
strict-origin-when-cross-origin for most sites. It keeps full URLs on your own origin, sends only the origin to other HTTPS sites and nothing over plain HTTP. Use no-referrer or same-origin on pages whose URLs contain tokens or personal data.
Is strict-origin-when-cross-origin already the default?
Yes, in current browsers: Chrome changed its default in version 85 (August 2020) and Firefox in version 87 (March 2021). Sending the header still makes the choice explicit, protects users of older browsers and passes security scanners.
Why is it Referer and not Referrer?
The request header was misspelled Referer in the original HTTP specification and kept for compatibility. The response header is spelled correctly: Referrer-Policy. A header named Referer-Policy is ignored by browsers.
Will a strict Referrer-Policy break my analytics?
Not for your own pages: same-origin requests still carry the full URL with strict-origin-when-cross-origin. Your policy only changes what other sites see about your pages. What your analytics sees about incoming traffic depends on the referring site's policy, not yours.
Can I rely on the Referer header for CSRF protection?
No. Browsers, extensions and policies such as no-referrer can remove it. Use CSRF tokens or SameSite cookies, and check the Origin or Sec-Fetch-Site request headers as an extra layer.
Can I set the referrer policy in HTML?
Yes. <meta name="referrer" content="no-referrer"> sets it for the whole page and overrides the header. The referrerpolicy attribute and rel="noreferrer" set it for one link, image, script or iframe. WebSec0 only reads the header.
Why does WebSec0 warn about no-referrer-when-downgrade?
It was the browser default before 2020 and sends the full URL, path and query string included, to every other HTTPS site. It only removes the referrer on HTTPS to HTTP requests, which are rare today.
References
Sources
- Referrer-Policy headerMDN Web Docs
- Referer header: privacy and security concernsMDN Web Docs
- A new default Referrer-Policy for Chrome: strict-origin-when-cross-originChrome for Developers
- Firefox 87 trims HTTP Referrers by default to protect user privacyMozilla Security Blog
