Skip to content
XSS Write-up Intermediate

1-Click Account Takeover (ATO) via CORS Misconfiguration

The sign-in page's callbackUrl parameter allowed an open redirect and then JavaScript execution, and the session endpoint returned the access token to same-origin requests. An attacker could chain these to steal a victim's access token and take over their account.

mohammed01550038865 Follow

Published on medium.com

The original lives on medium.com

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 callbackUrl parameter was not validated against a safe list, allowing javascript: URLs, and the session endpoint relied only on same-origin checks that could be bypassed by running script from the same origin.

Impact

An attacker could steal a victim's access token and use it to take over the account and access any data available with that token.

What the attacker needed

Victim clicks a crafted link; victim is logged in

How it was found

  1. Visit the sign-in page and notice the callbackUrl parameter.
  2. Test callbackUrl with a protocol-relative URL to confirm an open redirect.
  3. Test callbackUrl with a javascript: URL to confirm reflected XSS.
  4. Find the /api/auth/session endpoint that returns the access token.
  5. Create a script that fetches /api/auth/session with credentials and sends the response to an attacker server.
  6. Encode the script as a javascript: URL in callbackUrl and send it to a victim.

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 login page had a parameter that told it where to send you after signing in, and it did not check that the destination was safe. The author first made it redirect to another site, then made it run JavaScript, and finally used that JavaScript to read the user's session token from the same site and send it to the attacker. With that token, the attacker can act as the victim.

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 mohammed01550038865

View all

1 more disclosed report, 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.