From 0814fa76f870b3afaa1559ca648769453e5fbb03 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 25 Jan 2016 15:26:52 +0100 Subject: [PATCH 1/2] FIX CVE CVE-2015-8685 --- htdocs/main.inc.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 7fba7f50247..90eac774407 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -80,13 +80,15 @@ function test_sql_and_script_inject($val, $type) // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) if ($type != 2) { - $sql_inj += preg_match('/delete[\s]+from/i', $val); - $sql_inj += preg_match('/create[\s]+table/i', $val); - $sql_inj += preg_match('/update.+set.+=/i', $val); - $sql_inj += preg_match('/insert[\s]+into/i', $val); - $sql_inj += preg_match('/select.+from/i', $val); - $sql_inj += preg_match('/union.+select/i', $val); - $sql_inj += preg_match('/(\.\.%2f)+/i', $val); + $sql_inj += preg_match('/delete\s+from/i', $val); + $sql_inj += preg_match('/create\s+table/i', $val); + $sql_inj += preg_match('/update.+set.+=/i', $val); + $sql_inj += preg_match('/insert\s+into/i', $val); + $sql_inj += preg_match('/select.+from/i', $val); + $sql_inj += preg_match('/union.+select/i', $val); + $sql_inj += preg_match('/into\s+(outfile|dumpfile)/i', $val); + $sql_inj += preg_match('/(\.\.%2f)+/i', $val); + $sql_inj += preg_match('/onerror=/i', $val); } // For XSS Injection done by adding javascript with script // This is all cases a browser consider text is javascript: @@ -94,7 +96,8 @@ function test_sql_and_script_inject($val, $type) // All examples on page: http://ha.ckers.org/xss.html#XSScalc $sql_inj += preg_match('/