Twitter Card - Parent Window Redirection
A Twitter Card iframe allowed JavaScript to run inside it, and that script could redirect the parent window to an arbitrary site. An attacker could use a crafted shared URL to send a victim's browser to a different page.
- Triaged in 2 hours
- Fixed in 3 hours
- Paid in 24 hours
- Disclosed after 3 months
Hi, I was trying to find XSS on another website and I finally did.
After that I tried share this url on Twitter to show website owner, and noticed that I can run javascript on that iframe.
Javascript that I used on Twitter Card :
<script>top.window.location.href="https://google.com.tr"</script>You can watch PoC
Attachments
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A victim viewing a crafted shared link could be redirected from Twitter to an attacker-controlled page.
What the attacker needed
A URL with an XSS payload; victim views the shared link on Twitter
How it was found
- Find a website with an XSS vulnerability and craft a URL that runs JavaScript.
- Share that URL on Twitter so a Card preview is generated.
- Observe that the JavaScript runs inside the Card iframe and redirects the top window.
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 report has not been written yet. The Original tab links to the source.
A Twitter Card is the preview box that appears when a link is shared. The report says JavaScript placed in that preview could run and change the whole page, sending the viewer to another website. That is dangerous because the preview should not be able to control the main Twitter page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.