Skip to content
Open redirect Write-up Intermediate

Google bug bounty for security exploit that influences search results

Google's sitemap ping mechanism followed cross-domain redirects and still associated the fetched sitemap with the original domain, allowing an attacker to submit sitemaps for sites they did not control. By including hreflang directives, an attacker could make their own site rank for high-value search terms by borrowing the victim site's link equity.

Tom Anthony Follow

Published on tomanthony.co.uk

Bounty$5,000 View original

As part of my regular research efforts, I recently discovered an issue to Google that allows an attacker to submit an XML sitemap to Google for a site for which they are not authenticated. As these files can contain indexation directives, such as hreflang, it allows an attacker to utilise these directives to help…

Tom Anthony (@TomAnthonySEO), on tomanthony.co.uk

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

Context

Google lets site owners submit an XML sitemap so that Googlebot can discover URLs to crawl. A sitemap can also carry hreflang directives, which tell Google about other international versions of the same page (for example, a US page and a German page on a different URL). The researcher notes that it is not known exactly how Google uses these directives, but it appears hreflang lets one URL borrow link equity and trust from another: most people link to the US .com version, and the German version can borrow that equity to rank better in Google.de.

There are three ways to submit a sitemap: through Google Search Console, inside robots.txt, or via a special ping URL. The report describes a logic flaw in the ping path: an attacker could submit a sitemap for a site they do not control, and use the directives inside it to make their own site rank.

The researcher believes this was the first time Google awarded a bounty for a security issue in the search engine itself that directly affects site ranking. Google awarded $5000.

Setup

The experiment cost $12, which the researcher describes as the cost of a domain. The moving parts were:

  1. A fake domain for a UK-based retail company that does not operate in the USA. The company and industry are anonymised in the report and referred to as victim.com.
  2. An AWS server that mimicked the victim's site, built mainly by harvesting the legitimate content and retooling it (changing currency, address and so on).
  3. A fake sitemap hosted on evil.com containing only URLs for victim.com, with hreflang entries pointing each URL to an equivalent URL on evil.com and indicating that evil.com was the US version.
  4. An open redirect on victim.com, used to submit that sitemap through Google's ping mechanism.

No accounts, roles or software versions are given beyond this. The tools mentioned are SEMRush, Searchmetrics and Google Search Console, used to observe the results.

Finding it

The researcher started from the ping mechanism. Google's own documentation seemed conflicting: at the top of the page it refers to submitting sitemaps via ping, but at the bottom there is a warning.

From the original on tomanthony.co.uk

In the researcher's experience you could absolutely submit new XML sitemaps via ping, with Googlebot typically fetching the file within 10 to 15 seconds. Google also states a couple of times on the page that a sitemap submitted via ping will not show up inside Search Console.

From the original on tomanthony.co.uk

As a related test, the researcher tried adding other known search directives (noindex, rel-canonical) via XML sitemaps, and also tried a range of XML exploits, but Google did not seem to use them.

Search Console rejects cross-domain sitemaps

Submitting a sitemap through Search Console behaves differently. If the sitemap includes URLs for another domain you are not authorised for, GSC rejects it.

From the original on tomanthony.co.uk

This is the control case: the normal submission path enforces domain ownership. The question was whether the ping path did the same.

Open redirects

Many sites use a URL parameter to control a redirect. In the report's example, the user would be redirected after login to page.html. Some sites with poor hygiene allow open redirects, where the parameter allows redirecting to a different domain. Often no interaction such as a login is needed, so the user is redirected straight away.

From the original on tomanthony.co.uk

Open redirects are very common and often considered not too dangerous; Google does not include them in its bug bounty programme for that reason. Companies do try to protect against them where possible, but the protection can often be circumvented.

From the original on tomanthony.co.uk

The report gives Tesco as an example: a UK retailer with more than £50 billion in revenue, over £1 billion of it via its website. The researcher reported that example to Tesco, along with a number of others to other companies found during the research, and Tesco has since fixed it.

Exploitation

Step 1: confirm that ping follows cross-domain redirects

When you ping an XML sitemap and the submitted URL is a redirect, Google follows the redirect, even if it is cross domain. More importantly, Google still associates the sitemap with the domain that did the redirect, and treats the sitemap found after the redirect as authorised for that domain.

From the original on tomanthony.co.uk

In the example, evil.xml is hosted on blue.com, but Google associates it as belonging to, and being authoritative for, green.com. That is the core of the flaw: the ping path trusts the redirecting domain's authority for content served from somewhere else.

Step 2: build the experiment

The researcher created the fake domain and the AWS server mimicking the victim, then created the sitemap on evil.com containing only victim.com URLs. Each URL carried an hreflang entry pointing to the equivalent URL on evil.com, marking it as the US version of victim.com. The sitemap was submitted via an open redirect URL on victim.com using Google's ping mechanism.

Step 3: observe the ranking effect

Within 48 hours the site started getting small amounts of traffic for long tail terms, shown in a SEMRush screenshot.

From the original on tomanthony.co.uk

A couple more days later the site was appearing for competitive terms on the first page, against the likes of Amazon and Walmart.

From the original on tomanthony.co.uk

Step 4: observe the Search Console side effects

Google Search Console for evil.com indicated that victim.com was linking to evil.com, although that was not the case.

From the original on tomanthony.co.uk

At that point the researcher found he could also submit XML sitemaps for victim.com inside GSC for evil.com.

From the original on tomanthony.co.uk

It seemed Google had linked the two sites, and evil.com's Search Console now had some ability to influence victim.com's setup. Indexation for the submitted sitemaps could now be tracked, with thousands of pages indexed.

Searchmetrics showed the increasing value of the traffic.

From the original on tomanthony.co.uk

Google Search Console showed over a million search impressions and over 10,000 clicks from Google search, and at that point the researcher had done nothing other than submit the XML sitemap.

The researcher notes that he was not letting people check out on the evil site. Had he wanted to, the traffic could have been monetised through scams, ads or otherwise. In his view this posed a serious risk to Google visitors and to companies relying on Google search for traffic. Traffic was still growing, but the experiment was shut down and follow-up experiments aborted for fear of doing damage.

Root cause

The flaw is in how the ping mechanism resolves the submitted URL. When the pinged URL redirects, Google follows the redirect across domains and attributes the fetched sitemap to the domain that issued the redirect, rather than to the domain that actually served the file. The sitemap is then treated as authorised for the redirecting domain.

Search Console already enforced ownership: it rejected sitemaps containing URLs for domains the submitter was not authorised for. The ping path did not apply the same check, so the ownership boundary that GSC enforced could be bypassed by routing the submission through an open redirect on the target domain. The report does not describe the internal implementation, so the exact reason the redirect target was trusted is not stated; the behaviour is what was observed.

The researcher suggested that Google should not follow cross-domain redirects for pinged sitemaps, since there is little good reason for it, and that following redirects could be a GSC-only feature.

Impact

An attacker can submit XML sitemaps for a site they do not control, and send Google search directives for that site. Using hreflang, the attacker can make their own site borrow the victim's link equity and trust, and rank for the victim's terms in another country. The report's experiment achieved first-page rankings for high-value terms in the US against Amazon and Walmart, with a newly registered domain that had no inbound links. The Adwords bid price for some of those terms was around $1 per click at the time, and companies spend tens of thousands of dollars a month to appear as ads on those results.

The method is entirely undetectable for victim.com: the sitemaps do not show up on their end, and when the attacker leverages link equity for a different country, the activity can fly under the radar. Competitors in the country being targeted would be left baffled by the performance of the attacker's site.

The researcher frames this as the first example he is aware of of an outright exploit in the algorithm, rather than manipulation of ranking factors. The potential financial impact seems non-trivial: imagine the potential profit from targeting Tesco or a similar company. The report hedges that more tests were planned to investigate this but could not be run without potentially causing damage.

Fix

Google fixed the issue. The report does not describe the code change. The researcher's suggestion, sent to Google during the back and forth, was not to follow cross-domain redirects for pinged sitemaps, and to make redirect following a GSC-only feature if needed. Google confirmed the fix was live on 25th March 2018 and gave the green light to publish.

Disclosure timeline

Date Event
23 September 2017 Initial bug report filed.
25 September 2017 Google responded; the bug was triaged and being looked into.
2 October 2017 More details sent.
9 October to 6 November 2017 Back and forth status updates.
6 November 2017 Google said the report was hard to determine in terms of prevention and impact, and that a team would make a final decision after sifting through data on how prevalent the behaviour was.
6 November 2017 Researcher replied suggesting not following cross-domain redirects for pinged sitemaps.
3 January 2018 Status update requested.
15 January 2018 Google replied that it did not want to close the report earlier because it could not get a definitive decision on whether the redirect chain could be addressed without breaking legitimate use cases.
15 February 2018 Google said a bug had been filed and the VRP board would discuss a bounty.
6 March 2018 Google awarded a bounty of $1337.
6 March 2018 Researcher shared a draft of the post and asked for the green light to disclose.
12 March 2018 Google said the fix was not complete and asked him to hold off.
25 March 2018 Google confirmed the fix was live and gave the green light.
17 April 2018 Google upgraded the bounty to $5000.

Variants to test

  1. Ping a sitemap through an open redirect on a target domain. Submit the ping URL with a redirect parameter pointing to a sitemap you host. A positive result is Googlebot fetching your file within seconds and the sitemap being treated as belonging to the redirecting domain.
  2. Check whether the target's Search Console reflects the submission. If GSC for your own domain starts showing the target domain as linking to you, or lets you submit sitemaps for the target, the association has been made.
  3. Test hreflang borrowing. Put only the target's URLs in the sitemap, each with an hreflang entry pointing to your equivalent URL for another country. A positive result is your site appearing for the target's terms in that country.
  4. Test other directives. The researcher tried noindex and rel-canonical via sitemaps and Google did not seem to use them, so these are worth retesting but were negative in this report.
  5. Look for open redirects that survive protection. The report notes companies try to protect against open redirects and that the protection can often be circumvented; a positive result is a redirect parameter that still reaches an external domain.

If you have questions or comments, the researcher can be contacted at the address linked in the original post, on Twitter at @TomAnthonySEO, or via Distilled.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

A security researcher found a way to make his own brand new website appear in Google search results next to Amazon, Walmart and Target, for valuable shopping search terms in the United States. He did it without buying ads, without building links, and without owning the company whose reputation he was borrowing. The whole experiment cost him $12, the price of registering one domain name.

Google fixed the problem and paid him a bug bounty of $5000. A bug bounty is a reward a company pays to someone who reports a security problem responsibly instead of abusing it.

The trick relied on two ordinary features of the web that most people never think about: XML sitemaps, which are files that tell Google which pages exist on a site, and open redirects, which are links that send a visitor on to another address. Put together in a particular way, they let an attacker speak to Google as if they owned somebody else's website.

This article walks through the whole story from the beginning, explaining each idea as it appears. You only need to know how to use a browser.

Background: how Google learns about pages

XML sitemaps

A website is a collection of pages. Google cannot magically know that a new page exists unless something points it there. One of the ways site owners help Google is by publishing an XML sitemap: a file, written in a structured format called XML, that lists the addresses (URLs) of the pages on the site. Think of it as an index at the back of a book: it does not contain the story, but it tells you where every chapter is.

A sitemap can do more than list pages. It can carry directives, which are instructions to Google about how to treat those pages. One important directive is hreflang. It tells Google about international versions of the same page. For example, a shop might have a US page and a German page with the same product. The hreflang directive says, in effect: "this is the US page, and here is the German version over there."

The researcher notes that nobody outside Google knows exactly how these directives are used inside the ranking algorithm. But it appears hreflang lets one page borrow link equity and trust from another. Link equity is the informal idea that a page linked to by many other sites is treated as more trustworthy, and that trust can be shared with related pages. Most people link to the US .com version of a site, so the German version can borrow that trust and rank better on Google.de.

Three ways to submit a sitemap

Google accepts sitemaps through three routes:

  1. Google Search Console (GSC): a dashboard where a site owner proves they control a domain and then manages how Google sees it.
  2. Inside robots.txt: a small text file at the root of a site that gives instructions to search engine crawlers. A crawler (Googlebot is Google's) is the program that visits pages and reads them.
  3. A special ping URL: a web address you can request in your browser or with a script, which tells Google "please fetch this sitemap now".

The report is about a logic flaw in that third route. A logic flaw is not a broken password or a crashed server; it is a situation where the software does exactly what it was programmed to do, but the rules it follows can be combined in a way the designers did not intend, like a shop loyalty scheme that can be gamed by following its own rules literally.

The researcher believes this was the first time Google paid a bounty for a security issue in the search engine itself that directly affects how sites rank.

Setting up the experiment

The researcher spent $12, which he describes as the cost of a domain. The pieces he assembled were:

  1. A fake domain for a UK-based retail company that does not operate in the USA. The company and its industry are anonymised in the report and called victim.com.
  2. An AWS server (AWS is Amazon Web Services, a service for renting computers on the internet) that mimicked the victim's site. He built it mainly by harvesting the legitimate content and retooling it: changing the currency, the address and so on.
  3. A fake sitemap hosted on evil.com that contained only URLs for victim.com. Each of those URLs carried an hreflang entry pointing to an equivalent URL on evil.com, marking evil.com as the US version.
  4. An open redirect on victim.com, used to submit that sitemap through Google's ping mechanism.

To watch what happened, he used three tools: SEMRush and Searchmetrics, which are services that estimate how much traffic and value a site gets from search, and Google Search Console itself.

Finding the flaw

The ping mechanism

The researcher started with the ping route. Google's own documentation seemed contradictory: near the top of the page it describes submitting sitemaps by ping, but at the bottom there is a warning.

From the original on tomanthony.co.uk

In his experience, you could absolutely submit new XML sitemaps by ping, and Googlebot would typically fetch the file within 10 to 15 seconds. Google also says a couple of times on the page that a sitemap submitted by ping will not appear inside Search Console.

From the original on tomanthony.co.uk

That last detail matters later: if the submission does not show up in the victim's Search Console, the victim has no obvious way to notice it.

As a side test, he tried adding other well-known search directives (noindex, which asks Google not to show a page in results, and rel-canonical, which says which URL is the "main" version of a page) through XML sitemaps. He also tried a range of XML exploits. Google did not seem to use any of them.

Search Console rejects cross-domain sitemaps

Submitting through Search Console behaves differently. If a sitemap includes URLs for another domain that you are not authorised for, GSC rejects it.

From the original on tomanthony.co.uk

This is the control case. The normal path checks that you really own the domain before accepting instructions about it. The question the researcher then asked was simple: does the ping path do the same check?

Open redirects

Many sites use a URL parameter to control where a visitor ends up. A URL parameter is the part of an address after a question mark, used to pass small pieces of information. In the report's example, the user would be redirected after login to page.html.

From the original on tomanthony.co.uk

Some sites with poor hygiene allow what are called open redirects: the parameter is allowed to point at a different domain entirely.

From the original on tomanthony.co.uk

Often no interaction such as a login is needed, so the visitor is sent on straight away.

From the original on tomanthony.co.uk

Open redirects are very common and are often considered not too dangerous, which is why Google does not include them in its bug bounty programme. Companies do try to protect against them, but the protection can often be circumvented.

From the original on tomanthony.co.uk

The report gives Tesco as an example: a UK retailer with more than £50 billion in revenue, over £1 billion of it through its website. The researcher reported that example to Tesco, along with several others to other companies he found during the research, and Tesco has since fixed it.

Exploiting it

Step 1: confirm that ping follows cross-domain redirects

When you ping an XML sitemap and the URL you submit is a redirect, Google follows the redirect, even when it leads to a different domain. More importantly, Google still associates the sitemap with the domain that issued the redirect, and treats the file it finds after the redirect as authorised for that domain.

From the original on tomanthony.co.uk

In the example, evil.xml is hosted on blue.com, but Google treats it as belonging to, and being authoritative for, green.com. That is the heart of the flaw: the ping route trusts the redirecting domain's authority for content that is actually served from somewhere else. It is a bit like a hotel reception accepting a room-service order because the caller used the hotel's own phone system, without checking that the caller is a guest.

Step 2: build the experiment

The researcher created the fake domain and the AWS server mimicking the victim. He then made the sitemap on evil.com, containing only victim.com URLs, each with an hreflang entry pointing to the equivalent URL on evil.com and marking it as the US version of victim.com. He submitted that sitemap through an open redirect URL on victim.com, using Google's ping mechanism.

Step 3: watch the rankings move

Within 48 hours the site began getting small amounts of traffic for long tail terms. Long tail terms are very specific, less popular search phrases; they are easier to rank for than broad ones. A SEMRush screenshot showed this.

From the original on tomanthony.co.uk

A couple of days later the site was appearing for competitive terms on the first page, against the likes of Amazon and Walmart.

From the original on tomanthony.co.uk

Step 4: the Search Console side effects

Google Search Console for evil.com indicated that victim.com was linking to evil.com, although that was not true.

From the original on tomanthony.co.uk

At that point the researcher found he could also submit XML sitemaps for victim.com inside GSC for evil.com.

From the original on tomanthony.co.uk

It seemed Google had linked the two sites, and evil.com's Search Console now had some ability to influence victim.com's setup. He could now track indexation for the sitemaps he had submitted, and thousands of pages were indexed. Indexation means Google has stored a page in its searchable database.

Searchmetrics showed the traffic becoming more valuable.

From the original on tomanthony.co.uk

Google Search Console showed over a million search impressions and over 10,000 clicks from Google search. An impression is a time a page was shown in results, whether or not anyone clicked. And at that point the researcher had done nothing except submit the XML sitemap.

He notes that he was not letting people check out on the evil site. Had he wanted to, the traffic could have been monetised through scams, ads or other means. In his view this posed a serious risk to Google users and to companies that rely on Google search for traffic. Traffic was still growing, but he shut the experiment down and aborted follow-up experiments for fear of doing damage.

Root cause

The flaw is in how the ping mechanism resolves the submitted URL. Resolving here means following the address to whatever it finally points at. When the pinged URL redirects, Google follows the redirect across domains and attributes the fetched sitemap to the domain that issued the redirect, rather than to the domain that actually served the file. The sitemap is then treated as authorised for the redirecting domain.

Search Console already enforced ownership: it rejected sitemaps containing URLs for domains the submitter was not authorised for. The ping route did not apply the same check, so the ownership boundary that GSC enforced could be bypassed by routing the submission through an open redirect on the target domain. The report does not describe the internal implementation, so the exact reason the redirect target was trusted is not stated; the behaviour is what was observed.

The researcher suggested that Google should not follow cross-domain redirects for pinged sitemaps, since there is little good reason for it, and that following redirects could be a Search Console only feature.

Impact

An attacker can submit XML sitemaps for a site they do not control, and send Google search directives for that site. Using hreflang, the attacker can make their own site borrow the victim's link equity and trust, and rank for the victim's terms in another country. The experiment achieved first-page rankings for high-value terms in the US against Amazon and Walmart, with a newly registered domain that had no inbound links.

The Adwords bid price for some of those terms was around $1 per click at the time. Adwords is Google's advertising system, where advertisers pay for each click on their ad. Companies spend tens of thousands of dollars a month to appear as ads on those results, and the researcher was appearing for free.

The method is entirely undetectable for victim.com: the sitemaps do not show up on their end, and when the attacker borrows link equity for a different country, the activity can fly under the radar. Competitors in the targeted country would be left baffled by the performance of the attacker's site.

The researcher frames this as the first example he is aware of of an outright exploit in the algorithm, rather than manipulation of ranking factors. The potential financial impact seems non-trivial: imagine the potential profit from targeting Tesco or a similar company. He hedges that more tests were planned but could not be run without potentially causing damage.

Fix

Google fixed the issue. The report does not describe the code change. The researcher's suggestion, sent during the back and forth, was not to follow cross-domain redirects for pinged sitemaps, and to make redirect following a Search Console only feature if needed. Google confirmed the fix was live on 25 March 2018 and gave the green light to publish.

Disclosure timeline

Date Event
23 September 2017 Initial bug report filed.
25 September 2017 Google responded; the bug was triaged and being looked into.
2 October 2017 More details sent.
9 October to 6 November 2017 Back and forth status updates.
6 November 2017 Google said the report was hard to determine in terms of prevention and impact, and that a team would make a final decision after sifting through data on how prevalent the behaviour was.
6 November 2017 Researcher replied suggesting not following cross-domain redirects for pinged sitemaps.
3 January 2018 Status update requested.
15 January 2018 Google replied that it did not want to close the report earlier because it could not get a definitive decision on whether the redirect chain could be addressed without breaking legitimate use cases.
15 February 2018 Google said a bug had been filed and the VRP board would discuss a bounty.
6 March 2018 Google awarded a bounty of $1337.
6 March 2018 Researcher shared a draft of the post and asked for the green light to disclose.
12 March 2018 Google said the fix was not complete and asked him to hold off.
25 March 2018 Google confirmed the fix was live and gave the green light.
17 April 2018 Google upgraded the bounty to $5000.

Variants to test

  1. Ping a sitemap through an open redirect on a target domain. Submit the ping URL with a redirect parameter pointing to a sitemap you host. A positive result is Googlebot fetching your file within seconds and the sitemap being treated as belonging to the redirecting domain.
  2. Check whether the target's Search Console reflects the submission. If GSC for your own domain starts showing the target domain as linking to you, or lets you submit sitemaps for the target, the association has been made.
  3. Test hreflang borrowing. Put only the target's URLs in the sitemap, each with an hreflang entry pointing to your equivalent URL for another country. A positive result is your site appearing for the target's terms in that country.
  4. Test other directives. The researcher tried noindex and rel-canonical through sitemaps and Google did not seem to use them, so these are worth retesting but were negative in this report.
  5. Look for open redirects that survive protection. The report notes companies try to protect against open redirects and that the protection can often be circumvented; a positive result is a redirect parameter that still reaches an external domain.

If you have questions or comments, the researcher can be contacted at the address linked in the original post, on Twitter at @TomAnthonySEO, or via Distilled.

Glossary

  • XML sitemap: a structured file that lists the URLs of a site's pages and can carry instructions about them.
  • XML: a text format for structured data, using tags to label pieces of information.
  • URL: the address of a page or file on the web.
  • Directive: an instruction to a search engine, such as "do not index this page" or "here is the international version".
  • hreflang: a directive that tells Google about international versions of the same page.
  • Link equity: the informal idea that trust from links pointing at a page can be shared with related pages and help them rank.
  • Googlebot: Google's crawler, the program that visits pages and reads them.
  • Crawler: a program that automatically visits web pages to collect information.
  • Google Search Console (GSC): Google's dashboard where site owners verify ownership and manage how their site appears in search.
  • robots.txt: a text file at the root of a site that gives instructions to crawlers.
  • Ping URL: a web address that, when requested, asks Google to fetch a sitemap immediately.
  • Logic flaw: a weakness where software follows its own rules correctly but in a way the designers did not intend.
  • Bug bounty: a reward paid by a company to someone who reports a security problem responsibly.
  • AWS: Amazon Web Services, a service for renting computers and servers over the internet.
  • URL parameter: the part of an address after a question mark, used to pass small pieces of information.
  • Open redirect: a redirect controlled by a URL parameter that can send a visitor to any domain, including one the site owner does not control.
  • Redirect: an instruction to the browser to go to a different address.
  • Cross-domain: involving two different domain names.
  • Domain: a name that identifies a website, such as example.com.
  • Resolve: to follow an address through any redirects to whatever it finally points at.
  • Long tail terms: very specific, less popular search phrases, which are easier to rank for.
  • Indexation: the process of Google storing a page in its searchable database.
  • Impression: a time a page was shown in search results, whether or not it was clicked.
  • Adwords: Google's advertising system, where advertisers pay for clicks on their ads.
  • Noindex: a directive asking Google not to show a page in search results.
  • rel-canonical: a directive saying which URL is the main version of a page.
  • SEMRush: a service that estimates search traffic and keyword performance.
  • Searchmetrics: a service that estimates the value of search traffic.
  • VRP: Google's Vulnerability Reward Program, which handles bug bounty reports.

More by Tom Anthony

View all

4 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.