Gareth Heyes wrote a
CSRF chatbox, where he gets around the CSRF tokens by making the user click the save button manually. We've also had cases where JavaScript can be used to intercept user keystrokes and put them inside a file box, so we can get them to upload arbitrary files.
I'm wondering if there are any techniques people have used to both to prevent this type of exploit, and make the exploit more effective. For instance, Gareth's PoC is fairly crude, but I'm sure with a bit more CSS trickery the Save button could be made to look like a normal form element.
It seems to me, however, that this sort of thing would be pretty hard to sort out on the browser level without making iframes distinct from the rest of the page (apart from banning iframes outright, with javascript). Also, making it difficult to predict the position of the button on the website would probably help things out too.
Once again, I apologize if this has been discussed before.
HTML Purifier - Standards Compliant HTML filtering