Skip to content
XSS Write-up Beginner

Reading My Crush Messages Through Xss

The error parameter on the site reflected base64-decoded input without sanitisation, allowing script injection. An attacker could steal a victim's session cookies and take over their account.

Shashwat Kumar Follow

Published on infosecwriteups.com

This is a belated post as this incident took place when I used to be in college last year.

Shashwat Kumar, on infosecwriteups.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 application decoded the base64 error parameter and inserted it into the page without sanitising or escaping it, and session cookies lacked the HttpOnly flag.

Impact

The attacker could take over the victim's account and read all her messages; the exploit worked because the session cookies lacked the HttpOnly flag.

What the attacker needed

Victim clicks a crafted link; attacker can host a listener

How it was found

  1. Open the shared link and inspect the error parameter.
  2. Notice the error parameter is base64-encoded and reflected on the page.
  3. Encode a script payload in base64 and place it in the error parameter.
  4. Send the crafted link to the victim.
  5. Receive the victim's cookies on an external service.
  6. Replace cookies in a tool and access the victim's 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 took text from a link and put it straight into the page without cleaning it. That let the author insert a small script that ran in the victim's browser and sent her login cookies to the author. With those cookies, the author could log in as her and read her messages.

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 Shashwat Kumar

View all

4 more disclosed reports, 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.