diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-03-27 16:32:51 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-03-27 17:02:55 +0100 |
commit | 395b74051ce974ced8a5abe378f66e9bcf0c8e34 (patch) | |
tree | 2d438a7c9e7767759ebffe70530683240fb53232 /program/steps | |
parent | 268a28efb25193e5f48e7ba8e41f0bca8306c34e (diff) |
Whitelist configuration options (user preferences) that can be changed using save-pref command
Conflicts:
program/lib/Roundcube/rcube_plugin.php
program/lib/Roundcube/rcube_plugin_api.php
Conflicts:
CHANGELOG
program/steps/utils/save_pref.inc
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/utils/save_pref.inc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/program/steps/utils/save_pref.inc b/program/steps/utils/save_pref.inc index 616d13bc1..0bc731abf 100644 --- a/program/steps/utils/save_pref.inc +++ b/program/steps/utils/save_pref.inc @@ -5,7 +5,7 @@ | program/steps/utils/save_pref.inc | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2010, The Roundcube Dev Team | + | Copyright (C) 2005-2013, The Roundcube Dev Team | | Licensed under the GNU GPL | | | | PURPOSE: | @@ -14,13 +14,26 @@ +-----------------------------------------------------------------------+ | Author: Aleksander Machniak <alec@alec.pl> | +-----------------------------------------------------------------------+ - - $Id$ - */ $name = get_input_value('_name', RCUBE_INPUT_POST); $value = get_input_value('_value', RCUBE_INPUT_POST); +$whitelist = array( + 'preview_pane', + 'list_cols', + 'collapsed_folders', + 'collapsed_abooks', +); + +if (!in_array($name, array_merge($whitelist, $RCMAIL->plugins->allowed_prefs))) { + raise_error(array('code' => 500, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => sprintf("Hack attempt detected (user: %s)", $_SESSION['username'])), + true, false); + + $OUTPUT->reset(); + $OUTPUT->send(); +} // save preference value $RCMAIL->user->save_prefs(array($name => $value)); @@ -42,4 +55,3 @@ if ($sessname = get_input_value('_session', RCUBE_INPUT_POST)) { $OUTPUT->reset(); $OUTPUT->send(); - |