Day 5: Chaining Bugs from Self-XSS to Full Account Takeover
A stored HTML injection in a user preferences field could be escalated to script execution by sending the payload in a JSON request, bypassing the WAF. The preferences endpoint also lacked CSRF header validation, allowing an attacker to perform actions on behalf of a victim and steal their session cookie, leading to account takeover.
Published on medium.com
🔍 Vulnerability Type: Self-XSS → WAF Bypass → CSRF Bypass → ATO 🎯 Target: Redacted Online Store 💰 Severity: P2 (High)
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
Impact
An attacker could steal a victim's session cookie and achieve full account takeover, but the exploit required the victim to visit a malicious site while logged in.
What the attacker needed
Victim logged in; victim visits attacker's site
The fix
The application should sanitise user input, enforce CSRF validation on all state-changing endpoints, and use HTTP-only cookies for session tokens.
How it was found
- Inject a basic HTML payload into the first_name field of the preferences endpoint.
- Observe that the WAF blocks script execution with a 403 Forbidden response.
- Modify the request to use JSON format and send the payload in the brands_to_stock[] field.
- Observe that the payload executes successfully, bypassing the WAF.
- Remove the CSRF token from the request header and send the request again.
- Observe that the request is accepted, allowing CSRF.
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 saved user input without cleaning it, so an attacker could inject code that runs in a victim's browser. The site also failed to check a security token on one request, letting an attacker make changes as the victim. Together, this let an attacker steal the victim's login session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.