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.
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…
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
- Find a site with a reflected XSS vulnerability where a URL parameter is inserted into the page without sanitisation.
- Craft a URL that injects JavaScript to add a link or replace content.
- Submit the URL to Google's Mobile Friendly Tool to confirm Google's rendering service executes the injected code.
- Submit the page to the Google index and check the cached version shows the injected link.
- Use Google's URL Inspector Tool to confirm an injected canonical tag is treated as the true canonical.
- 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.