The Day Google Search Got Hacked: A Real Story of XSS in the Wil
Google Search did not properly sanitise some search parameters, allowing attackers to inject JavaScript into search results pages. An attacker could run arbitrary JavaScript in a victim's browser, leading to popups, redirects, or cookie theft.
If you’re anything like me, you probably trust Google with your life. We search for everything from “Why is my plant dying?” to “How to act normal in front of your crush?” But what if I told you that, once upon a time, clicking a simple Google Search link could hack your browser?
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 insufficient output encoding or sanitisation of search parameters, allowing injected JavaScript to execute in the page.
Impact
Attackers could run any JavaScript in a victim's browser, potentially stealing session cookies or redirecting users to malicious sites, though the text does not confirm a specific real-world compromise.
What the attacker needed
Victim clicks a crafted Google search link
The fix
Google patched the issue by adding stricter output encoding and browser-level protections such as the XSS Auditor.
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.
Cross-site scripting (XSS) is when a website lets an attacker sneak their own code into a page that other people view. Here, Google Search failed to clean up some parts of the web address, so a crafted link could make the page run the attacker's code in your browser. That code could then do things like show fake popups or steal your login cookies.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.