I recently discovered a very straightforward XSS vulnerability with /admin/listcontent.php and /admin/listusertags.php. Using an URL like /admin/listcontent.php?message=%3Cscript%3Ealert('XSS')%3C/script%3E will expose the vulnerability.
IMHO, the most appropiate fix would be to only allow alphanumeric characters (also '_' and '-') in the message key, and sanitize it in /lib/translation.functions.php like this:
Code: Select all
--- /home/arwan/tmp/cmsmadesimple-1.0beta4/lib/translation.functions.php 2006-03-28 03:14:43.000000000 +0200
+++ lib/translation.functions.php 2006-08-13 13:45:43.000000000 +0200
@@ -51,6 +51,9 @@
return '';
}
+ # sanitize $name
+ $name = preg_replace('/[^\w\d_-]/', '', $name);
+
//echo strtolower(get_encoding()) . ':' . strtolower($nls['encoding'][$gCms->current_language]);
$result = '';