includes/functions.php
changeset 316 42419c99471c
parent 308 25691e0841f1
child 318 eec2dfd2f0a3
--- a/includes/functions.php	Sat Jan 17 11:31:45 2009 -0500
+++ b/includes/functions.php	Sat Jan 17 11:32:18 2009 -0500
@@ -1854,6 +1854,11 @@
   // <
   // The rule is so specific because everything else will have been filtered by now
   $html = preg_replace('/<(script|iframe)(.+?)src=([^>]*)</i', '&lt;\\1\\2src=\\3&lt;', $html);
+  
+  // Vulnerability reported by fuzion from nukeit.org:
+  // XSS in closing HTML tag style attribute
+  // Fix: escape all closing tags with non-whitelisted characters
+  $html = preg_replace('!</((?:.*)([^a-z0-9-_:]+)(?:.*))>!', '&lt;/\\1&gt;', $html);
 
   // Restore stripped comments
   $i = 0;