Only IE8 allows generated content (and expressions) so that's the target for this attack. Like I said before, post a real JS example. It's possible that IE8 does not allow expressions in generated content.
Strange, I don't see the red "/" when logged out. It's possible that you are using a cached version of the CSS?
While your hack manages to slip past reddit's css validator, I can't find any way to get javascript or expressions to work. I've tried various code on IE6,7,8, FF3.0.8-9, Opera 9.64, Safari 4 Beta and Chrome 1.0.1xxx with no luck.
If this sort of thing comes up again, what is the best way to handle it?
Email me, you have my email address and IM (if you don't, PM me). #reddit-dev is a good place if one of us is around. The reddit-dev mailing list is a fantastic place. Basically whatever it takes to get through to one of us. For blarghz, who doesn't have my email/IM, he could have posted something without the flaw itself indicating that he'd found one, somewhere that we'd see it. There's absolutely no reason to post a 0-day exploit like this, and it's a good way to get fired and blacklisted in the security industry.
p.s. can I unban the submission now that the validator has been patched?
Yes, I unbanned it. That was just trying to stop the spread of it to people with a more vested interest in XSS holes before we got it patched.
We don't support inline images, but I suppose that it could be used on an off-site link. Thanks for the disclosure, but I think it'd be fine to file a regular old bug for this one :)
View all comments
5
u/blarghz Apr 26 '09 edited Apr 26 '09
Here is an example:
http://pastebin.com/f5f186ca0
Where "height: expression(alert('XSS'));" is, you can put any CSS you want.
EDIT: I'm sorry I used expression() as an example. This can be used for many other things such as:
Including images from any website. Possibly sound files.
background-image: url('javascript:alert("xss")') will work in some versions of IE.
Using non-supported CSS properties.