Clickjacking XSS on google
The Google Crisis Map application validated a layer's source URL only on the client side, allowing a javascript: URI to be saved and later used as a link. An attacker could publish a map containing such a link and use clickjacking to trick a victim into clicking it, executing JavaScript in the google.org origin.
Published on websecblog.com
One of the lesser-known Google projects is Google Crisis Map. It was created to help people find and use critical emergency information.
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
Impact
An attacker could execute arbitrary JavaScript in the google.org origin when a victim interacts with a clickjacked iframe, potentially leading to account compromise or data theft, though the attack required multiple user clicks and the XSS was initially self-XSS.
What the attacker needed
A Google account with a custom domain email; victim visits attacker's website; victim clicks twice in the iframe
The fix
The fix was to validate the URL before inserting it into the DOM, using a safe fallback like about:invalid if the URL is not allowed.
How it was found
- Log in to Google Crisis Map with a non-gmail account and create a new map.
- Add a new layer, enter a title, and set the source URL to a valid URL such as https://example.com.
- Save the layer and intercept the save request with a proxy.
- Replace the source URL with a javascript: URI and forward the request.
- Reload the map page, open the Layers view, and click the Download KML link to trigger the XSS.
- Publish the map and embed it in an iframe on an attacker-controlled site, using CSS to position the iframe so clicks on the attacker's page correspond to the Layers tab and then the Download KML link.
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.
The website checked that a link looked safe only in the browser, not on the server. So an attacker could bypass that check and save a malicious link. Then, by embedding the map in another site, they could trick a user into clicking the link, which would run harmful code in the user's browser on the google.org site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.