3 ms·
On further inspection, I don't trust your implementation at all. You're blacklisting CSS rules and attributes rather than whitelisting them. This means you woul
by simonw 17y ago
On further inspection, I don't trust your implementation at all. You're blacklisting CSS rules and attributes rather than whitelisting them. This means you wouldn't catch attacks like this one, for example:
http://www.davidpashley.com/blog/computing/livejournal-mozilla-bug.html http://www.davidpashley.com/blog/computing/livejournal-mozil...
I also don't think you're the right thing when you DO find something that's not on the whitelist - you should be escaping it rather than stripping it (we couldn't have a discussion about your code using your system, since our XSS examples would be stripped).
I'd suggest re-engineering to use a whitelist for everything.