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.
Published on medium.com
Hola, this is Renwa from Kurdistan i’m glad to write my first write-up about infosec and Bugbounties.
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
- Find that the display name reflects a script payload when the page is refreshed.
- Capture the name-change request in an intercepting proxy.
- Generate a CSRF proof-of-concept form for that request.
- Add the script payload to the last name field and auto-submit the form on load.
- Have the victim open the hosted form so their name is changed.
- 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.