Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Fixed sanitizeHTML() 'on' attributes sanitization when attribute has '>', vulnerability reported by @EvidentObscurity

givanzc466e618ad1b
diff --git a/system/functions.php b/system/functions.php
index 18d47d7..399c1bd 100755
--- a/system/functions.php
+++ b/system/functions.php
@@ -1452,6 +1452,7 @@ function sanitizeHTML($string) {
// Remove any attribute starting with "on" or xmlns
$string = preg_replace('#(<[^>]+?[\x00-\x20"\'/])(?:on|xmlns)[^>]*+>#iu', '$1>', $string);
+ $string = preg_replace('#[\x00-\x20"\'/](on|xmlns)[:\w]+[\x00-\x20"\'/]*=[\x00-\x20"\'/]*([\'"]+).+?\2#iu', '', $string);
// Remove javascript: and vbscript: protocols
$string = preg_replace('#([a-z]*)[\x00-\x20]*=[\x00-\x20]*([`\'"]*)[\x00-\x20]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iu', '$1=$2nojavascript...', $string);