Skip to content
Info disclosure Disclosed report Advanced CVE-2021-23971

Full referrer URL exposed even from websites using strict referrer policies (e.g. "no-referrer" or "strict-origin-when-cross-origin")

Firefox incorrectly handled referrer policies on redirects, causing the full URL of the original page to be sent as the Referer header even when the page's policy was 'no-referrer' or 'strict-origin-when-cross-origin'. An attacker controlling a redirect could therefore learn the exact URL a user visited, including any sensitive path or query parameters.

Luca Moretto Follow

Originally disclosed on Mozilla

  • Fixed in 27 days
  • Paid in 46 days
  • Disclosed after 27 days
Text
Created attachment 9189089
referrer-stealing-poc.tgz

I discovered this issue while studying the Referrer-Policy standard (https://w3c.github.io/webappsec-referrer-policy/).

This seems to be caused by a wrong implementation of the standard, more in particular for what concerns the combination of "8.2. Set request’s referrer policy on redirect" and "8.3. Determine request’s Referrer".

If a server (also third-party ones) replies with a redirect response including a referrer-policy response header, it seems that, when computing the new referrer value for the redirected request, Firefox uses the document's URL as referrerSource, instead of the previously computed referrer value for the original request (which may even be "no-referrer"). This is in contrast with what the standard specifies and leads to this vulnerability. 

You can find more details in the attached PoC's README.md file.

I verified this issue on both Firefox 78.5.0esr and latest Firefox Nightly 85.0a1.

The original report as published on Mozilla's Bugzilla, by Luca Moretto. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a logic error in Firefox's referrer computation on redirects: it used the document's URL as the referrer source instead of the previously computed referrer value, contrary to the Referrer-Policy standard.

Impact

A malicious or compromised redirecting server could obtain the full URL of the page a user came from, even when that page set a strict referrer policy, potentially exposing sensitive information in the URL.

What the attacker needed

Victim visits a page with a strict referrer policy; victim follows a link to a redirecting server

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you click a link, your browser can send a 'Referer' header telling the new site where you came from. Websites can set a policy to limit or block this header for privacy. This report shows that Firefox ignored that policy after a redirect, so the full address of the page you started from could leak to a third party.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.