4 points · by mshafrir · 17y ago · 9 comments
Everyone overcomplicated the issue, it's not a difficult issue to solve: whenever untrusted data is to be displayed to a user, escape it. Problem solved.
It's also definitely nice to have a dedicated qa person (preferably someone familiar with the code) trying to break your site, both manually and with tools like Selenium http://seleniumhq.org/
i don't see the benefit in filtering input; html and alert()'s inside a database don't affect anything until they come back out.
I think the risk of new techniques getting by this filter are low (although the risk of the filter having bugs is high, as judged by the number of bugs that popup in more critical software). In XSS there are only a limited set of attack vectors (iframe, javascript, flash), and those get filtered completely. The underlying filter is based on whitelisting, so it's not like new additions to the HTML spec are going to open security holes before we have a chance to close them (it's the opposite, new, safe HTML additions will need to be explicitly allowed before they can be used).
If you're planning on doing this yourself, OWASP (www.owasp.org) is a great resource.