Skip to content
XSS Write-up Intermediate

Chain 4 Vulnerabilities To Reach Maximum Impact Possible

A search box reflected script from the query string, letting an attacker run code in a victim's browser and read their cookies. The stolen access token could then be used to change the victim's password without any anti-CSRF token, and old sessions stayed valid after the change.

medium.com

Published on medium.com

Hey Guys, I’ll show you today my last finding in a company maybe going to be a tech unicorn very soon! The name of the company is obscure based on a policy of the company itself.

Psycho02, 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 search parameter was written into the HTML without encoding, the password-change endpoint trusted only the bearer token with no CSRF protection, and sessions were not invalidated on password change.

Impact

A victim who clicks a crafted link could have their session token stolen, their password changed and their account taken over, and the old session keeps working afterwards.

What the attacker needed

Victim clicks a crafted link; victim is logged in; attacker hosts a webhook endpoint

How it was found

  1. Enter a script payload in the search box and see it execute.
  2. Send the victim's cookie value to an attacker-controlled endpoint using a script in the page.
  3. Read the user_access_token from the captured request.
  4. Replay the password-change request with that token in the Authorization header.
  5. Use the email returned in the response to sign in as the 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.

A search page put whatever the visitor typed back into the page without cleaning it, so text that looks like code runs in the browser. That let the author read the visitor's login cookie, a small piece of data the site uses to recognise them. With that cookie the author could send a password-change request as the victim, because the site did not ask for any extra proof that the request came from the real user.

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.