Skip to content

armgit / Vvveb

Public Imported from GitHub
0

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

Fixed null bytes vulerability in sanitizeFileName function https://github.com/givanz/Vvveb/issues/333 vulnerability reported by @Huu1j

givanzb0fa7ff74a35
diff --git a/system/functions.php b/system/functions.php
index 0665a15..231e59e 100755
--- a/system/functions.php
+++ b/system/functions.php
@@ -1011,6 +1011,8 @@ function sanitizeFileName($file) {
return $file;
}
+ //remove null bytes
+ $file = str_replace(chr(0), '', $file);
//sanitize, remove double dot .. and remove get parameters if any
$file = preg_replace('@\?.*$|\.{2,}|[^\/\\a-zA-Z0-9\-\._]@' , '', $file);
$file = preg_replace('@[^\/\w\s\d\.\-_~,;:\[\]\(\)\\]|[\.]{2,}@', '', $file);