summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-09-29 20:30:10 +0000
committerthomascube <thomas@roundcube.net>2005-09-29 20:30:10 +0000
commit539cd47824ec6b03b44f9f7c5af8a1e60df0458b (patch)
treeec90fc2acd6dab9ad71bc19a51ee9d989a4e3ef5 /index.php
parent30233b8dfb7fe5070dfa11b3e6d2015fb50aa769 (diff)
Fix for URL injection vulnerability (Bug #1307966)
Diffstat (limited to 'index.php')
-rw-r--r--index.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/index.php b/index.php
index 19623aa30..bdccd379f 100644
--- a/index.php
+++ b/index.php
@@ -267,7 +267,19 @@ if ($_task=='settings')
}
+// only allow these templates to be included
+$valid_tasks = array('mail','settings','addressbook');
+
// parse main template
-parse_template($_task);
+if (in_array($_task, $valid_tasks))
+ parse_template($_task);
+
+// if we arrive here, something went wrong
+raise_error(array('code' => 404,
+ 'type' => 'php',
+ 'line' => __LINE__,
+ 'file' => __FILE__,
+ 'message' => "Invalid request"), TRUE, TRUE);
+
?> \ No newline at end of file