I\'ve often wondered -- why use a whitelist as opposed to a blacklist when sanitizing HTML input?
How many sneaky HTML tricks are there to open XSS vulnerabilities?
I prefer to have both, I call it the "Black List with Relaxed White List" approach:
This black list acts as an on-off switch for tags/attributes in the relaxed white list.
This "Black List with Relaxed White List" approach makes it much easier to configure the sanitizing filter.
As an example, the White List can contain all html5 tags and attributes. While the Black List can contain tags & attributes to be excluded.