Skip to content
XSS Write-up Intermediate

No Password, No Problem: Account Takeover via Cleverly Placed XSS

A reflected XSS in the countryCode parameter allowed an attacker to steal a victim's JWT token, which could then be used to change the victim's email address without re-verification, leading to full account takeover.

THE_DARK_KNIGHT Follow

Published on medium.com

“بس� الله و الصلاة و السلا� على رسول الله الح� د لله الذي عل� بالقل� عل� الإنسان � ا ل� يعل� و الصلاة و السلا� على خير � عل� الناس الخير � ح� د”

THE_DARK_KNIGHT, on medium.com

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 countryCode parameter was reflected into an HTML attribute without proper encoding, and the WAF failed to block CSS animation event handlers.

Impact

An attacker could take over a victim's account by stealing their JWT and changing their email address, and the victim would be locked out.

What the attacker needed

Victim clicks a link; attacker has a webhook

How it was found

  1. Create a webhook on webhook.site
  2. Host a payload that uses the countryCode parameter to execute JavaScript and send the cookie to the webhook
  3. Send the malicious link to the victim
  4. Victim clicks the link, XSS fires, and JWT is leaked to the webhook
  5. Copy the victim's JWT token from the webhook
  6. Use the stolen JWT in the Authorization header to send a request that changes the email address, then submit the OTP sent to the attacker's email

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.

The website had a spot where text from the web address was shown on the page without being made safe. An attacker could craft a link that, when clicked, ran their own code in the victim's browser and stole the victim's login token. With that token, the attacker could change the victim's email address and take over the account.

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.