Skip to content
XSS Write-up Intermediate

Self XSS + CSRF to stored XSS

A user's display name was rendered without sanitisation, but the profile was private so the self-XSS alone had no impact. The name-change request lacked CSRF protection, so an attacker could host a form that set the victim's name to a script payload, turning it into stored XSS that fired on the homepage and exfiltrated data.

Renwa Hiwa Follow

Published on medium.com

Hola, this is Renwa from Kurdistan i’m glad to write my first write-up about infosec and Bugbounties.

Renwa, 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 name field was stored and rendered without output encoding, and the name-change endpoint accepted cross-site form submissions without a CSRF token.

Impact

Any user who opened the attacker's form had their name set to a script that ran on the homepage and sent their information to the attacker, since there was no CSP protection.

What the attacker needed

Victim opens attacker's HTML form; attacker hosts a page; no CSP on the site

How it was found

  1. Find that the display name reflects a script payload when the page is refreshed.
  2. Capture the name-change request in an intercepting proxy.
  3. Generate a CSRF proof-of-concept form for that request.
  4. Add the script payload to the last name field and auto-submit the form on load.
  5. Have the victim open the hosted form so their name is changed.
  6. Confirm the payload fires on the homepage and reports back to the XSS hunter service.

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 self-XSS is a script injection that only affects the person who types it in, so on its own it is useless to an attacker. Here the name-change form had no protection against being submitted from another website (that is CSRF, cross-site request forgery), so the attacker could make the victim's browser submit the malicious name for them. Once saved, the script ran for the victim on the homepage and sent their information to the attacker.

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 Renwa Hiwa

View all

10 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.