Skip to content
XSS Write-up Advanced

Over 1 Million websites are at risk of sensitive information leakage - XSS is dead. Long live XSS

A DOM-based XSS in Hotjar's dashboard allowed an attacker to execute JavaScript via a crafted link, and by combining it with OAuth, steal a victim's OAuth code and achieve account takeover. The attacker could then access sensitive user recordings and potentially take over websites.

Aviad Carmel Follow

Published on salt.security

Cross-site scripting (aka XSS) has rightfully claimed its place as one of the most popular web vulnerabilities. Since its first emergence, somewhere in the dark days of the internet, countless vulnerabilities have been found across websites everywhere.

Aviad Carmel, Security Researcher, on salt.security

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

What the attacker needed

Victim clicks a crafted link; victim has a Hotjar account; victim previously approved Hotjar in Google

The fix

The vulnerability was fixed by Hotjar.

How it was found

  1. Download all JavaScript files from the target site.
  2. Search for URLSearchParams(window.location.search) to find sources of user input.
  3. Identify a code path where a parameter is used in window.location.replace.
  4. Set a breakpoint and confirm the conditions: 'next' param present, not starting with '/', containing 'fromLMS' and 'returnURL'.
  5. Craft a URL with a javascript: payload in the returnURL parameter to trigger XSS.
  6. Use the XSS to open a new window for OAuth login and read the OAuth code from the URL.

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, the site had a flaw that let a specially crafted link run code, and because the site used Google login (OAuth), the attacker could steal the secret code that proves a user's identity. This let the attacker log in as the victim and see sensitive data.

What is XSS?

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

More by Aviad Carmel

View all

4 more disclosed reports, best first.

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.