Follow the Rabbit: How I Hacked My Way Through Google’s XSS Gam
The Google XSS Game contains six levels with different XSS vulnerabilities, including reflected, stored, DOM-based, and JavaScript context injection. An attacker could inject scripts to execute arbitrary JavaScript in a victim's browser.
Published on medium.com
In this post, I’ll walk you through Level 1: Hello, world of XSS, where we exploit a reflected XSS vulnerability.
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 application fails to sanitise or escape user-controlled input before inserting it into HTML, JavaScript, or URL contexts.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially stealing data or performing actions on their behalf.
What the attacker needed
Victim visits a crafted URL; victim loads a page with stored payload; victim clicks a crafted link
How it was found
- For Level 1, inject a script tag into the query parameter of the URL.
- For Level 2, submit a post containing an image tag with an onerror handler that calls alert.
- For Level 3, use the URL hash to break out of an image src attribute and add an onerror handler.
- For Level 4, inject a payload that breaks out of a JavaScript string inside an onload attribute.
- For Level 5, supply a javascript: URL as the next parameter to an anchor tag.
- For Level 6, bypass a filter by using an uppercase HTTPS scheme or a protocol-relative URL to load a script with a callback that executes alert.
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 a security flaw where a website displays user input without cleaning it, so an attacker can sneak in code that runs in other people's browsers. This write-up walks through a practice game with six levels, each showing a different way that code can slip in, such as through a URL parameter, a saved post, or a link.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.