AI summary by TwinMind
How The Self-Retweeting Tweet Worked: Cross-Site Scripting (XSS) and Twitter
Tom Scott
6m 17s
Twitter XSS Vulnerability Overview
- Twitter experienced self-retweeting tweet incident affecting 10.1 million BBC breaking news fans
- Web security 101 failure - basic filtering not implemented
- Users only saw little red love heart, not underlying malicious code
HTML and Web Security Fundamentals
- Web built on HTML - tag-based language
- Basic tags:
<b>for bold,<i>for italics - Special
<script>tag contains programming code executed by browsers (Firefox, Chrome, Internet Explorer) - Critical rule: never echo back user input without filtering to prevent cross-site scripting (XSS)
Cross-Site Scripting Attack Explanation
- Example: typing
<b>tag in Google search box without proper filtering - Dangerous when users can input
<script>tags - Unfiltered output allows malicious code execution in web pages
Twitter vs TweetDeck Security Comparison
- Twitter.com: properly filtered angle brackets, converted to safe display
- TweetDeck: forgot basic security filter - "web security 101" failure
- TweetDeck allowed script execution while Twitter blocked it
Malicious Code Breakdown
- Script tag with class "xss" for identification
- jQuery JavaScript library used for DOM manipulation
- Multi-step attack sequence:
Step 1: Element Selection
$('.xss')- finds script element with xss class.parents()- returns ordered list of parent containers[1]- selects second item (computers count from 0)- Targets specific tweet container block
Step 2: Retweet Button Targeting
.find('a')- locates all link tags in container[1]- selects second link (retweet button).click()- programmatically clicks retweet button- Triggers retweet dialog box
Step 3: Confirmation Bypass
$('[data-action=retweet]')- finds confirmation button.click()- automatically confirms retweet- Completes automated retweet process
Step 4: Alert Display
alert('XSS')- displays popup dialog- Shows "XSS" message identifying attack type
- Demonstrates successful cross-site scripting
Attack Characteristics
- 140 characters total (less than Twitter limit)
- Only affected TweetDeck users
- Victims saw only red heart emoji, not code
- Self-propagating through retweets
- Created "fairly significant disruption"
Security Impact
- First self-retweeting tweet in "very long time"
- Affected major news distribution (BBC breaking news)
- Demonstrated critical infrastructure vulnerability
- Single programmer error caused widespread impact
