XSS via Google Maps
A Google Maps endpoint reflected a user-supplied callback parameter without sanitisation, allowing script injection. An attacker could use this to bypass Content Security Policy on sites that allowlist maps.googleapis.com, enabling cross-site scripting.
medium.com
Published on medium.com
I also submitted this to the Google Bug Hunters program, but my report was marked as a duplicate. I asked what happened to the original report, and based on the response from Google, the initial submission had also been closed with a Won’t Fix status.
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 Google Maps endpoint failed to sanitise the callback parameter, allowing arbitrary JavaScript to be reflected.
What the attacker needed
Target site allows maps.googleapis.com in CSP; victim visits a crafted URL
The fix
The issue was not fixed by Google; third-party sites should avoid allowlisting maps.googleapis.com or ensure proper sanitisation.
How it was found
- Identify a Google Maps URL with a callback parameter.
- Replace the callback value with a JavaScript payload.
- Use the crafted URL on a site whose CSP allows maps.googleapis.com.
- The payload executes in the context of the target site.
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.
A website can tell the browser which other sites it trusts to load scripts from, using a rule called Content Security Policy (CSP). If a trusted site has a flaw that lets an attacker run their own script, the attacker can abuse that trust to run code on the protected site. Here, Google Maps had such a flaw, so sites that trusted Google Maps became vulnerable.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.