diff options
author | Andreas Gohr <andi@splitbrain.org> | 2007-08-29 22:15:38 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2007-08-29 22:15:38 +0200 |
commit | 634d7150e59d03e4a4987164bfe9948fb8828c70 (patch) | |
tree | 93357ea3c0c54840cf5ef040ecbc75ddbb3a5b66 /lib/plugins/revert | |
parent | 0e1a261ed103bc8f11934d76ec8c7ec412f02220 (diff) | |
download | rpg-634d7150e59d03e4a4987164bfe9948fb8828c70.tar.gz rpg-634d7150e59d03e4a4987164bfe9948fb8828c70.tar.bz2 |
CSRF prevention for admin plugins
This patch adds a session based token to all form in the default action plugins.
The validity of the token is checked before any administrative function is
executed aiming to protect DokuWiki's admin functions from Cross-site request
forgery (CSRF) attacks.
Another patch will follow to add the same functionality on other, less critical
functions.
More details on CSRF attacks can be found at
http://en.wikipedia.org/wiki/Cross-site_request_forgery
darcs-hash:20070829201538-7ad00-d0770224a3351fd8e38968e3a9d8e73520482445.gz
Diffstat (limited to 'lib/plugins/revert')
-rw-r--r-- | lib/plugins/revert/admin.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php index d148779d6..c96328981 100644 --- a/lib/plugins/revert/admin.php +++ b/lib/plugins/revert/admin.php @@ -67,7 +67,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { $this->_searchform(); - if(is_array($_REQUEST['revert'])){ + if(is_array($_REQUEST['revert']) && checkSecurityToken()){ $this->_revert($_REQUEST['revert'],$_REQUEST['filter']); }elseif(isset($_REQUEST['filter'])){ $this->_list($_REQUEST['filter']); @@ -133,6 +133,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { echo '<hr /><br />'; echo '<form action="" method="post">'; echo '<input type="hidden" name="filter" value="'.hsc($filter).'" />'; + formSecurityToken(); $recents = getRecents(0,$this->max_lines); echo '<ul>'; |