Google sites and exploiting same origin policy
A Google Sites HTML embed allowed JavaScript to make same-origin requests to sites.google.com with credentials, so an attacker could read a victim's sensitive data such as CSRF tokens and email addresses. The report claims the issue was closed as intended behaviour, then reopened and awarded a bounty.
Published on medium.com
I was learning about the same origin policy i.e; Response of ajax call can be captured only if the call is from same origin or headers like Access-Control-Origin/Credentials is present. (In simpler terms).
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 HTML embed ran with the same origin as sites.google.com instead of being isolated, so its scripts could read authenticated responses from the parent site.
Impact
An attacker could read a logged-in victim's sensitive Google Sites data, including CSRF tokens and email addresses, by getting them to visit a malicious site page.
What the attacker needed
Victim is logged in to Google; victim visits attacker's Google Site; attacker can create a Google Site
How it was found
- Create a Google Site and add an HTML embed containing JavaScript.
- The script sends a credentialed request to sites.google.com and forwards the response to an attacker-controlled server.
- Send the site link to an authenticated victim.
- Read the victim's sensitive data from the attacker server logs.
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.
Websites use a rule called the same-origin policy to stop one site from reading another site's private data. Here, a feature that lets people add their own HTML and JavaScript to a Google Site did not properly separate that code from Google's own site, so the code could read the logged-in user's data. An attacker only needed the victim to visit a page containing the malicious embed.
What is CORS?
A permissive cross-origin policy lets another site read responses with the user's credentials.