Expand file tree
A redirect endpoint accepted a javascript: URL and executed it when the user clicked a continue button, but only when the page was loaded inside an iframe because a regex blocked special characters on direct navigation. An attacker could frame the page, swap the URL to a javascript: payload after load, and steal the victim's cookies with one click.
github.com
Published on github.com
Hello, It's been a really long time since I shared any of my research/ findings lately, but in this writeup I'll share a vulnerability I found which was quite interesting to me and might change your perception towards "SELF XSS"
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 authenticated user who visits the attacker's page and clicks continue could have their cookie stolen, leading to account takeover.
What the attacker needed
Victim visits attacker's site; victim clicks continue button; endpoint lacks X-Frame-Options
How it was found
- Visit the redirect endpoint with a javascript: URL and observe the alert.
- Notice that direct navigation with special characters removes the continue button.
- Load the redirect page inside an iframe on an attacker-controlled site.
- Use JavaScript to replace the iframe source with a javascript: payload after the page loads.
- Click the continue button to execute the payload and capture the cookie.
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 website had a redirect page that would run JavaScript if you gave it a link starting with 'javascript:'. Normally the site blocked this when you opened the link directly, but if the page was embedded inside another site's frame, the attacker could change the link after the page loaded and trick the victim into clicking 'continue', which ran the attacker's code and sent the victim's login cookie 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.