Skip to content
XSS Write-up Advanced

Account takeover using Blind XSS?

A reflected cross-site scripting flaw in the RedirectUrl parameter could be triggered for logged-out users, and the application also hardcoded a CSRF token in client-side JavaScript. By combining these with a blind XSS payload, an attacker could steal an admin's CSRF token and user ID, then submit a forged request to change the admin's password without knowing the old one.

imwaiting18 Follow

Published on imwaiting18.medium.com

Hi Everyone, I want to share my recent finding on medium for all the bug bounty hunters and penetration testers. Before we jump into the juicy stuff, beginners go through the following piece of Information.

imwaiting18, on imwaiting18.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 RedirectUrl parameter was reflected into the page without proper encoding, and the application hardcoded a static CSRF token in client-side JavaScript instead of generating a per-session secret.

Impact

An attacker could take over an admin account by changing its password without knowing the old one, and no email notification was sent for password changes.

What the attacker needed

Victim is logged out to trigger the XSS; attacker can send a link to the victim; attacker can obtain the admin's email address

The fix

The application should properly encode the RedirectUrl parameter and generate a unique, unpredictable CSRF token per session instead of hardcoding it in client-side code.

How it was found

  1. Notice the RedirectUrl parameter and test it for open redirect and reflected XSS.
  2. Supply an additional RedirectUrl parameter containing an image tag with an onerror handler to break out of the URL and trigger the XSS for logged-out users.
  3. Observe that the application hardcodes a CSRF token in client-side JavaScript.
  4. Craft a blind XSS payload to steal the user's CSRF token and user ID cookie.
  5. Decode the CloudFront policy cookie to obtain the admin's user ID from the logo URL.
  6. Change the request method to GET, generate a CSRF proof of concept, and submit it to change the admin's password.

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 another user's browser. A CSRF token is a secret value meant to stop forged requests, but here it was hardcoded in the page's JavaScript, so anyone could read it. The attacker used the XSS to steal that token and the admin's user ID, then sent a request that changed the admin's password.

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 imwaiting18

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.