Gmail and Google+ - tale of two XSS-es
Two cross-site scripting flaws were found: one in Gmail's notification cookie and one in Google+'s photo upload response parameters. An attacker could use the Google+ flaw to set a cookie that triggers the Gmail flaw, leading to script execution on mail.google.com.
Published on blog.bentkowski.info
The original lives on blog.bentkowski.info
We do not hold its text, 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 Gmail notification cookie was rendered without proper encoding, and the Google+ upload response parameters were rendered as HTML without sanitisation.
Impact
An attacker could execute arbitrary JavaScript on mail.google.com and plus.google.com, potentially accessing the victim's Gmail data, but the Gmail exploit required a second XSS to set the cookie.
What the attacker needed
Victim visits a malicious page; attacker can host a page on a Google subdomain; victim uses Gmail basic HTML or old mobile view
The fix
Both issues were fixed by Google after being reported in March 2014.
How it was found
- Set a label in Gmail and observe that the notification content is stored in a cookie.
- Try inserting a custom HTML tag into the cookie value; a server error occurs when a greater-than character is included.
- Remove the greater-than character from the payload and confirm the alert fires, proving XSS on mail.google.com.
- In Google+ mobile photo upload, notice the puSuccessResponse and puFailureResponse parameters contain base64-encoded HTML.
- Decode puFailureResponse and confirm it is rendered even when the CSRF token is incorrect.
- Use the Google+ XSS to set a cookie for the google.com domain and redirect the user to Gmail to trigger the second XSS.
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) lets an attacker run their own JavaScript in a victim's browser on a trusted website. Here, one bug in Google+ allowed setting a cookie for the whole google.com domain, and a second bug in Gmail executed code from that cookie. Together they let the attacker run script on Gmail.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.