Referrer-Policy: Stop Leaking Sensitive URLs A developer behind PixelValut, a set of browser-side developer and security tools, published a practical checklist for auditing and hardening the Referrer-Policy response header. The writeup explains how browsers leak full URLs—including path segments, query strings and one-time tokens—through the Referer header, compares the available policy values, and recommends strict-origin-when-cross-origin as a safe default for most SaaS apps, with verification steps using curl and DevTools. Every time a user clicks from your app to a third-party link, the browser may send a Referer header with the full URL they came from—including path segments, query strings and sometimes one-time tokens. Password-reset links, signed download URLs, invite codes and internal admin paths have all leaked this way into analytics vendors, CDNs and support widgets. Referrer-Policy is the response header that decides how much of that URL other origins are allowed to see. Set it wrong or leave the browser default and you quietly ship secrets to whoever sits at the other end of the click. I build PixelValut https://pixelvalut.com/tools/?utm source=devto&utm medium=article&utm campaign=referrer-policy-stop-leaking-urls , a set of browser-side developer and security tools, and I wanted a practical checklist for teams that already ship HTTPS but never audited what their pages put in Referer . I wrote this with help from AI tools and checked every command and claim myself. This piece covers the policy values that matter, real leak scenarios, how to set and verify the header with curl and DevTools, and a safe default for most SaaS apps. Direct answer: Referrer-Policy tells browsers how much of the current page URL to put in the Referer header and in document.referrer when the user navigates or loads a subresource. Policies range from sending nothing no-referrer to sending the full URL even on HTTPS→HTTP downgrades. Pick a value that keeps path and query off cross-origin requests unless you truly need them for analytics. | Policy | Same-origin request | Cross-origin HTTPS→HTTPS | HTTPS→HTTP downgrade | Typical use | |---|---|---|---|---| | no-referrer | No Referer | No Referer | No Referer | Highest privacy; breaks referrer-based analytics | | no-referrer-when-downgrade | Full URL | Full URL | No Referer | Old browser default; still leaks path/query cross-origin | | origin | Origin only | Origin only | Origin only | Soft analytics without paths | | origin-when-cross-origin | Full URL | Origin only | Origin only | Good balance for many apps | | same-origin | Full URL | No Referer | No Referer | Strict; third parties see nothing | | strict-origin | Origin only | Origin only | No Referer | Origin for peers; strip on downgrade | | strict-origin-when-cross-origin | Full URL | Origin only | No Referer | Current browser default on modern engines; solid SaaS default | | unsafe-url | Full URL | Full URL | Full URL | Almost never justified | Modern Chrome, Firefox and Safari effectively default to strict-origin-when-cross-origin when the site sends no policy. That is better than the old no-referrer-when-downgrade default, but it still sends your full path and query to other pages on the same origin, and your origin scheme + host + port to other HTTPS sites. If a reset link lives at https://app.example.com/reset?token=… and the user clicks a cross-origin help article, the token stays off the wire—only https://app.example.com/ is sent. If that help widget is same-site or you used unsafe-url , the token can leave the browser. Treat these as design cases, not one-off bugs: Referer unless the policy strips them. /admin/users/123/impersonate . Even without tokens, path leakage tells an external script who you were looking at. unsafe-url and older defaults are how full URLs end up on cleartext hops. This sits next to transport controls like MTA-STS for inbound email https://dev.to/muhammadalimughal/mta-sts-and-tls-rpt-enforce-tls-for-inbound-email-3c2g and certificate issuance limits via CAA records and CT logs https://dev.to/muhammadalimughal/caa-records-and-ct-logs-control-who-issues-your-certs-29db : each closes a different disclosure channel. Referrer policy closes the browser-navigation channel. | Weak | Hardened | Why | |---|---|---| | No Referrer-Policy header | Referrer-Policy: strict-origin-when-cross-origin | Explicit beats relying on each browser's default | | unsafe-url "so analytics works" | origin or strict-origin-when-cross-origin plus server-side UTM on outbound links you control | You do not need full paths in third-party logs | | Token in query on a marketing page that loads many third-party scripts | Move secrets to POST body, fragment, or one-time server session; keep same-origin or no-referrer on that route | Headers cannot fix a secret that must never leave | | Only a