Skip to content
XSS Write-up Intermediate

XSS attacks google bot index manipulation

Googlebot renders pages with an outdated Chrome engine that lacks an XSS Auditor, so an attacker can craft a URL with injected JavaScript that alters the page content, links and canonical tags as seen by Google. This could let an attacker manipulate search results by injecting links or replacing page content on victim domains.

Tom Anthony Follow

Published on tomanthony.co.uk

Last year I published details of an attack against Google’s handling of XML Sitemaps, which allowed an attacker to ‘borrow’ PageRank from other sites and rank illegitimate sites for competitive terms in Google’s search results. Following that, I had been investigating other potential attack when my colleague at…

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.

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

How it worked

Root cause

Likely the crawler uses an old browser engine without an XSS filter and executes unsanitised JavaScript from URLs, so injected code changes the rendered page.

Impact

An attacker could manipulate Google search results by injecting links or replacing page content on vulnerable sites, potentially affecting rankings and users, though the author did not test actual ranking manipulation.

What the attacker needed

Victim site has an XSS vulnerability; attacker can get URL crawled by Google; no user interaction required

The fix

The issue was not fixed at the time of disclosure; the author suggests site owners should eliminate XSS vulnerabilities and monitor server logs for suspicious URLs.

How it was found

  1. Find a site with a reflected XSS vulnerability where a URL parameter is inserted into the page without sanitisation.
  2. Craft a URL that injects JavaScript to add a link or replace content.
  3. Submit the URL to Google's Mobile Friendly Tool to confirm Google's rendering service executes the injected code.
  4. Submit the page to the Google index and check the cached version shows the injected link.
  5. Use Google's URL Inspector Tool to confirm an injected canonical tag is treated as the true canonical.
  6. Place a link to a new test domain on the victim page, submit it, and observe Googlebot crawling the target page.

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 write-up has not been written yet. The Original tab links to the source.

When a website puts part of the web address into the page without cleaning it first, an attacker can add their own code to the address. If that code runs in the browser, it is called cross-site scripting (XSS). Google's crawler, the program that reads pages for search, runs this code too, so the attacker can change what Google sees and indexes.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.