Skip to content
XSS Write-up Advanced

Escalating an HTML Injection into 1-Click Account Takeover

An SSRF endpoint on a whitelisted subdomain allowed HTML injection, and by chaining it with an SSO returnUrl parameter, an attacker could redirect a victim's browser to leak the JWT token via the Referer header, achieving one-click account takeover.

marxchryz Follow

Published on marxchryz.medium.com

Hello everyone, I am Marx Chryz and I’m a HTB CWEE, CPTS, and CBBH passer. I will show you a write up about a vulnerability I found chaining multiple vulnerabilities to achieve 1-click account takeover.

Marx Chryz Del Mundo, on marxchryz.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 SSRF endpoint allowed fetching arbitrary URLs and returning their content without sanitisation, enabling HTML injection on a whitelisted subdomain, combined with an SSO returnUrl that accepted any subdomain and a referrer policy that leaked full URLs.

Impact

An attacker could achieve one-click account takeover by stealing the victim's JWT token, but the exploit relies on the victim clicking a link and the SSO returnUrl accepting the whitelisted subdomain.

What the attacker needed

Victim clicks a link; attacker controls a server; SSO returnUrl accepts *.redacted.com

How it was found

  1. Identify an SSRF endpoint on files.redacted.com that returns fetched content.
  2. Host a page with meta tags for referrer policy and redirect on an attacker server.
  3. Craft an SSO URL with returnUrl pointing to the SSRF endpoint fetching the attacker page.
  4. Send the crafted URL to a victim to trigger the OAuth flow.
  5. Victim's browser follows redirect and sends the full Referer containing the JWT to the attacker's logger.
  6. Attacker captures the JWT from logs and uses it to take over the account.

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 feature that fetched other web pages for you, but it didn't check what it fetched, so an attacker could make it show their own HTML. The login system passed a secret token in the URL, and by using a redirect trick, the attacker could make the victim's browser send that token to the attacker's server. This let the attacker log in as the victim with just one click.

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.