How I Turned a Boring Self-XSS into a Real-World Attack Using CSR
A stored XSS vulnerability in the account settings page required manual user input, making it self-XSS. The endpoint lacked CSRF protection, so an attacker could force a logged-in victim's browser to submit a forged request that stored the XSS payload, turning it into a remote stored XSS.
Published on medium.com
Sometimes, the difference between a low-impact bug and a high-impact vulnerability is just one good idea.
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
The account settings endpoint accepted state-changing POST requests without a CSRF token, allowing an attacker to submit a forged request on behalf of a logged-in user.
Impact
This could allow session hijacking, account manipulation, phishing injection, and malicious redirects, though the text does not show a live exploit against a real victim.
What the attacker needed
Victim is logged in; victim clicks a link to attacker page
The fix
The endpoint should be fixed by implementing CSRF tokens, enforcing SameSite cookies, using proper output encoding, and adding a strong Content Security Policy.
How it was found
- The victim logs into the website.
- The victim visits a malicious page hosted externally.
- The malicious page auto-submits a form to the account settings endpoint.
- The forged request stores the XSS payload in the victim's profile.
- The stored XSS executes in the victim's session.
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.
Self-XSS is a cross-site scripting bug that only affects the person who types the malicious code into their own account, so it is usually considered low risk. Here, the settings page that saved the user's name and phone number did not check for a secret token that proves the request came from the site itself. That missing check let an attacker make the victim's browser send the malicious code automatically, so the victim did not have to type anything.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.