Escalating Self-XSS with Disk Cache
A self-XSS vulnerability combined with login/logout CSRF allowed an attacker to cache a sensitive page under the victim's session and then use the self-XSS to retrieve the cached page and exfiltrate session data. The attacker could steal the victim's session cookie by forcing the victim to visit a malicious page that triggers the chain.
medium.com
Published on medium.com
Hello everyone! I’m here to share my Self-XSS escalation write-up, one that took me multiple failed attempts before I finally cracked it with some much needed help. huge thanks to Jorian for helping me complete this exploit (check him out if you haven’t already phenomenal hacker).
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 the victim's session data, potentially leading to account takeover.
What the attacker needed
Victim clicks a link; attacker-controlled page; self-XSS vulnerability present; login/logout CSRF present
How it was found
- Tab A opens Tab B and redirects through a client-side gadget to the sensitive page, caching it.
- Tab B performs logout and login CSRF, then redirects to the self-XSS path.
- The self-XSS executes and fetches the sensitive page with force-cache, reads the cached response, and exfiltrates the session data.
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 type of cross-site scripting where the attacker tricks the victim into running malicious code in their own browser, often by pasting it into a form. Here, the attacker combined this with login/logout CSRF (cross-site request forgery) to make the victim's browser cache a sensitive page, then used the self-XSS to read that cached page and send the data to the attacker. This let the attacker steal the victim's session, which could allow them to act as the victim.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.