Skip to content
XSS Write-up Intermediate

XSS in Gmail through Rapportive

A stored cross-site scripting vulnerability existed in the Rapportive browser extension because user-supplied location data was inserted into Gmail's page without proper escaping. An attacker could execute arbitrary JavaScript in the context of mail.google.com, potentially affecting other users who viewed the attacker's profile.

blog.kotowicz.net

Published on blog.kotowicz.net

It's that magical time of the year, when wonders happen... Everyone's getting big presents.

The author, on blog.kotowicz.net

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

The extension used Handlebars triple-brace syntax ({{{ }}}) which disables HTML escaping, and failed to sanitise user-controlled location data before inserting it into the page.

Impact

The stored XSS could allow an attacker to execute arbitrary JavaScript in the Gmail origin, potentially hijacking sessions and creating a self-spreading worm, though the text does not confirm actual exploitation beyond a demonstration.

What the attacker needed

Victim uses the Rapportive extension; Victim views the attacker's profile

The fix

The vulnerability was fixed by the vendor after the report.

How it was found

  1. The attacker sets their location in the Rapportive profile to a malicious script payload.
  2. The payload is stored on the server and later rendered without escaping when the profile is viewed.
  3. When a victim using Rapportive views the attacker's profile in Gmail, the script executes in the Gmail origin.
  4. The script can then spread the infection to the victim's own profile and perform actions on their behalf.

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 browser extension called Rapportive added extra information to Gmail. It failed to clean up text that users could control, so an attacker could insert malicious code that would run when other people looked at their profile. This let the attacker do things like read emails or spread the attack further.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.