From 43abcd93867996e32890fa101ae09255ccc24847 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 1 Jun 2009 22:40:22 -0700 Subject: Security pass over all controller code. Mostly adding CSRF checking and verifying user permissions, but there are several above-the-bar changes: 1) Server add is now only available to admins. This is a hard requirement because we have to limit server access (eg: server_add::children) to a user subset and the current permission model doesn't include that. Easiest fix is to restrict to admins. Got rid of the server_add permission. 2) We now know check permissions at every level, which means in controllers AND in helpers. This "belt and suspenders" approach will give us defense in depth in case we overlook it in one area. 3) We now do CSRF checking in every controller method that changes the code, in addition to the Forge auto-check. Again, defense in depth and it makes scanning the code for security much simpler. 4) Moved Simple_Uploader_Controller::convert_filename_to_title to item:convert_filename_to_title 5) Fixed a bug in sending notification emails. 6) Fixed the Organize code to verify that you only have access to your own tasks. In general, added permission checks to organize which had pretty much no validation code. I did my best to verify every feature that I touched. --- modules/akismet/controllers/admin_akismet.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/akismet') diff --git a/modules/akismet/controllers/admin_akismet.php b/modules/akismet/controllers/admin_akismet.php index 7485f283..9ba89bd4 100644 --- a/modules/akismet/controllers/admin_akismet.php +++ b/modules/akismet/controllers/admin_akismet.php @@ -22,6 +22,9 @@ class Admin_Akismet_Controller extends Admin_Controller { $form = akismet::get_configure_form(); if (request::method() == "post") { + // @todo move the "post" handler part of this code into a separate function + access::verify_csrf(); + $valid = $form->validate(); if ($valid) { -- cgit v1.2.3 From d0845aadc629cf10b8eee490a651c039750a1430 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 1 Jun 2009 23:08:13 -0700 Subject: Workaround for parse_ini_file issue: There's no way to escape a double-quote in a value that's read with parse_ini_file. Using single quotes instead, even if that's not the best style in English. --- modules/akismet/module.info | 2 +- modules/recaptcha/module.info | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/akismet') diff --git a/modules/akismet/module.info b/modules/akismet/module.info index dd2df5dd..8655927d 100644 --- a/modules/akismet/module.info +++ b/modules/akismet/module.info @@ -1,3 +1,3 @@ name = Akismet -description = "Filter comments through the Akismet web service to detect and eliminate spam. You'll need a WordPress.com API key to use it." +description = "Filter comments through the Akismet web service to detect and eliminate spam. You'll need a WordPress.com API key to use it." version = 1 diff --git a/modules/recaptcha/module.info b/modules/recaptcha/module.info index 134ae31c..85397580 100644 --- a/modules/recaptcha/module.info +++ b/modules/recaptcha/module.info @@ -1,3 +1,3 @@ name = Recaptcha -description = "Recaptcha displays a graphical verification that protects the input form from abuse from "bots," or automated programs usually written to generate spam." +description = "Recaptcha displays a graphical verification that protects the input form from abuse from 'bots,' or automated programs usually written to generate spam." version = 1 -- cgit v1.2.3