How I turned self XSS to stored XSS via CSRF
A group creation dialog box rendered the group name without encoding, causing self-XSS. The group creation request lacked CSRF protection, so an attacker could force a victim to create a group with a malicious name, triggering the XSS once.
Published on medium.com
Curated list of Bug Bounty programs — https://bugbountydirectory.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 dialog box inserted the group name into the page without encoding it, and the group creation endpoint lacked a CSRF token.
Impact
An attacker could execute arbitrary script in a victim's browser once, after the victim visited a crafted link, which could lead to actions performed as the victim.
What the attacker needed
Victim visits attacker's link; victim logged in to the site
The fix
It was fixed by removing the dialog box and adding CSRF protection.
How it was found
- Create a group with a script payload in its name and observe the alert in the dialog box.
- Invite another user to the group and see that the payload is encoded for them, confirming self-XSS.
- Capture the group creation request and note the absence of a CSRF token.
- Build a CSRF proof of concept that submits the group creation request with the payload.
- Visit the proof of concept and observe the XSS execute in the dialog box.
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 had a pop-up message after you made a group that showed the group name as raw HTML instead of plain text. Normally only you would see this, so it was called self-XSS. But the request to create a group had no protection against being sent from another website, so an attacker could make your browser create a group with a harmful name, and the pop-up would run the attacker's script.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.