Subject: | XSS in example configuration |
HTML::Scrubber 0.03, tested under perl 5.008 on FreeBSD
The sample configuration in the docs with HTML::Scrubber 0.03 is vulnerable to the following cross site scripting constructs:
<br style="width: expression(alert())">
... and others, e.g. the xml* attributes that some versions of IE accept.
Suggested fix: give a whitelist based example with '*' => 0 for both tags and attributes and have a list of safe tags and a list of safe attributes.
<a href="javasc	ript:alert(1)">asdf</a>
... because both Netscape and IE will accept whitespace characters other than space in between the letters of the word 'javascript'.
<a href="vbscript:yada yada yada">asdf</a>
... there is 'about' as well as 'vbscript', and probably others. See http://www.securityfocus.com/archive/1/249779 for some more examples.
Suggested fix: change the regular expression from:
qr{^(?!(?:java)?script)}i
to:
qr{^(?:http|https|ftp)://}i