Referrer Cloaking: How It Works

Referrer cloaking is when a site checks the Referer header and shows the real page only to visitors who arrive from the right source, such as a search or ad click.

Referrer cloaking is when a site reads the Referer header (the page the visitor came from) and shows the real page only to visitors who came from the right place, such as a search result or an ad. Direct visits, which is how most reviewers and scanners open a URL, get the clean page.

How it works

In the Google study of ten cloaking services (Cloak of Visibility):

  • All six of the most advanced samples checked the HTTP Referer.
  • The software pulls the search terms out of the Referer with a pattern per search portal, then compares them with the operator’s lists of positive and negative keywords. A negative keyword, or no positive keyword, triggers the clean page.
  • The authors note that since Google moved logged-in searches to TLS in 2013, keywords no longer pass in the referrer, so keyword cloaking has lost its edge.

In the paper’s measurement of fingerprinting in the wild, “Has referrer set?” scored 6.1% for Google Search URLs and 5.4% for Google Ads URLs; “User has clicked?” scored 10.6% and 18.0%.

The study is from 2016. [TODO: newer source on referrer cloaking against ad review]

How to spot it

Load the URL with no referrer, then with a referrer set as if from an ad or a search, and compare. Free: website cloaking checker (direct vs ad-click referrer) or curl -e in the curl guide.

Limit: a site can also check that the visitor really clicked, not just the header (ad review cloaking).

User-agent cloaking · Redirect cloaking · Website cloaking

Questions

Why does a reviewer see a different page than a customer?

A reviewer usually opens the URL directly, with no referrer. A customer arrives from an ad. A site that only shows the real page to ad traffic hides it from direct visits.

How do I test referrer cloaking?

Request the page twice: once with no referrer, once with a referrer set as if from an ad or search click, then compare. With curl: curl -e 'https://www.google.com/' URL.