Highly wormable clickjacking in player card
The Twitter Player Card feature allowed embedding an iframe of a Twitter page, and because some browsers do not enforce the frame-ancestors CSP directive, an attacker could overlay bait content to trick users into clicking and performing actions like tweeting or following. This could lead to a wormable clickjacking attack.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 10 months
- Paid in 12 days
- Disclosed after 2.7 years
Summary by the researcher
https://blog.innerht.ml/google-yolo/
The report
Hi, I would like to report an issue where player card is vulnerable to clickjacking in certain browsers. This may result in something similar to XSS worm and many other critical damages.
##Details Twitter Player Card allows a website to embed a custom player(html) into an iframe in a tweet. There are currently 2-3 security features in place to defend clickjacking on Twitter:
X-Frame-Options: SAMEORIGINcovering the whole twitter.com domainContent-Security-Policy: frame-ancestors 'self'ditto- JS-based frame-buster in some pages (but not all)
For (1), SAMEORIGIN only checks if the embedded frame is on the same origin of the top window. For example, attacker can do something like twitter.com -> attacker.com -> twitter.com to evade it. More details can been seen from here: https://bugzilla.mozilla.org/show_bug.cgi?id=725490 For (2), this is the only way to correctly prevent framing from other websites (it performs the check against the ancestor list). However this is a CSP2 directive so not all browsers support it. For example, Safari and IE do not support it. For (3), using the sandbox attribute of iframe can disable JS of a frame, hence anti-frame-buster
Since Player Card is shown on a Tweet (on twitter.com), attacker can embed an iframe which embeds a Twitter page so that attacker can overlay it with "bait" content to lure victims to click on it.
The impact is huge because of the following facts:
- The card displays directly on the user's timeline, making the attack less suspicious to normal clickjacking
- The click is very subtle that victims cannot notice what's happened behind the scene
- Wormable because attacker can make victims tweet arbitrary content to spread it
- Can perform click-based critical actions, like follow, retweet, favorite... etc
- If sent as promoted tweet, it can target even more victims, also player is directly expanded
##Repo step
- Clone the Player Card started bundle here: https://github.com/twitterdev/cards
- Change the card's property twitter:player to a custom HTML file
- In the HTML file, embed iframe to a Twitter page, e.g.
<iframe src="//twitter.com"></iframe> - Post the link in a Tweet (make sure the domain is white-listed)
- Expand the tweet in Safari or IE, it will show that a Twitter page is embedded
Documentation of Player Card: https://dev.twitter.com/cards/types/player
##PoC
https://twitter.com/AttackerCanvas/status/637859735501279232 (Open with Safari or IE)
Video demo: https://vimeo.com/137725491 (password: click)
The PoC demonstrates how the attack can be conducted. There will be a fake video to lure victims to click to play it. After clicking the victim will automatically post a tweet with content "Pwn3d!".
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
Root cause
Likely the lack of browser support for the CSP frame-ancestors directive in Safari and IE, combined with the ability to embed a Twitter page inside a Player Card iframe, allowed clickjacking.
Impact
An attacker could perform click-based actions such as follow, retweet, favorite, and posting tweets, potentially creating a worm, but only in browsers that do not support CSP frame-ancestors (Safari and IE).
What the attacker needed
Victim uses Safari or IE; attacker controls a whitelisted domain; victim clicks on the tweet
The fix
The report does not state whether or how the issue was fixed.
How it was found
- Clone the Player Card starter bundle.
- Change the card's twitter:player property to a custom HTML file.
- In the HTML file, embed an iframe to a Twitter page.
- Post the link in a Tweet (ensure the domain is whitelisted).
- Expand the tweet in Safari or IE to see the embedded Twitter page.
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.
Clickjacking is when a malicious site tricks you into clicking something you didn't intend to, like a hidden button. Here, the attacker could put a Twitter page inside a tweet's player card and cover it with a fake video play button, so when you click, you actually click a Twitter button that posts a tweet or follows someone. This worked because some browsers (Safari and IE) don't support a security rule that stops pages from being embedded.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.