diff --git a/features.admin.inc b/features.admin.inc
index bfab042..7bc4327 100644
--- a/features.admin.inc
+++ b/features.admin.inc
@@ -661,7 +661,7 @@ function features_form_submit(&$form, &$form_state) {
   // page callback rather than as part of the submit handler as some modules
   // have includes/other directives of importance in hooks that have already
   // been called in this page load.
-  $form_state['redirect'] = 'admin/structure/features/cleanup/clear';
+  $form_state['redirect'] = array('admin/structure/features/cleanup/clear', array('query' => array('token' => drupal_get_token())));
 
   $features = $form['#features'];
   if (!empty($features)) {
@@ -683,15 +683,17 @@ function features_form_submit(&$form, &$form_state) {
 function features_cleanup_form($form, $form_state, $cache_clear = FALSE) {
   $form = array();
 
-  // Clear caches if we're getting a post-submit redirect that requests it.
-  if ($cache_clear) {
-    drupal_flush_all_caches();
+  if (!empty($_GET['token']) && drupal_valid_token($_GET['token'])) {
+    // Clear caches if we're getting a post-submit redirect that requests it.
+    if ($cache_clear) {
+      drupal_flush_all_caches();
 
-    // The following functions need to be run because drupal_flush_all_caches()
-    // runs rebuilds in the wrong order. The node type cache is rebuilt *after*
-    // the menu is rebuilt, meaning that the menu tree is stale in certain
-    // circumstances after drupal_flush_all_caches(). We rebuild again.
-    menu_rebuild();
+      // The following functions need to be run because drupal_flush_all_caches()
+      // runs rebuilds in the wrong order. The node type cache is rebuilt *after*
+      // the menu is rebuilt, meaning that the menu tree is stale in certain
+      // circumstances after drupal_flush_all_caches(). We rebuild again.
+      menu_rebuild();
+    }
   }
 
   // Retrieve orphaned modules and provide them as optional modules to be disabled.
@@ -737,37 +739,42 @@ function features_cleanup_form($form, $form_state, $cache_clear = FALSE) {
  * Submit handler for disable action on features_cleanup_form().
  */
 function features_cleanup_form_disable(&$form, &$form_state) {
-  if (!empty($form_state['values']['orphans'])) {
-    $disable = array_keys(array_filter($form_state['values']['orphans']));
-    $ignored = array_diff(array_keys($form_state['values']['orphans']), $disable);
 
-    // Disable any orphans that have been selected.
-    module_disable($disable);
-    drupal_flush_all_caches();
+  if (!empty($_POST['form_token']) && drupal_valid_token($_POST['form_token'], 'features_cleanup_form')) {
+    if (!empty($form_state['values']['orphans'])) {
+      $disable = array_keys(array_filter($form_state['values']['orphans']));
+      $ignored = array_diff(array_keys($form_state['values']['orphans']), $disable);
+
+      // Disable any orphans that have been selected.
+      module_disable($disable);
+      drupal_flush_all_caches();
 
-    // Add enabled modules to ignored orphans list.
-    $ignored_orphans = variable_get('features_ignored_orphans', array());
-    foreach ($ignored as $module) {
-      $ignored_orphans[$module] = $module;
+      // Add enabled modules to ignored orphans list.
+      $ignored_orphans = variable_get('features_ignored_orphans', array());
+      foreach ($ignored as $module) {
+        $ignored_orphans[$module] = $module;
+      }
+      variable_set('features_ignored_orphans', $ignored_orphans);
     }
-    variable_set('features_ignored_orphans', $ignored_orphans);
+    $form_state['redirect'] = 'admin/structure/features/cleanup';
   }
-  $form_state['redirect'] = 'admin/structure/features/cleanup';
 }
 
 /**
  * Submit handler for ignore action on features_cleanup_form().
  */
 function features_cleanup_form_ignore(&$form, &$form_state) {
-  if (!empty($form_state['values']['orphans'])) {
-    $ignored = array_keys($form_state['values']['orphans']);
-    $ignored_orphans = variable_get('features_ignored_orphans', array());
-    foreach ($ignored as $module) {
-      $ignored_orphans[$module] = $module;
+  if (!empty($_POST['form_token']) && drupal_valid_token($_POST['form_token'], 'features_cleanup_form')) {
+    if (!empty($form_state['values']['orphans'])) {
+      $ignored = array_keys($form_state['values']['orphans']);
+      $ignored_orphans = variable_get('features_ignored_orphans', array());
+      foreach ($ignored as $module) {
+        $ignored_orphans[$module] = $module;
+      }
+      variable_set('features_ignored_orphans', $ignored_orphans);
     }
-    variable_set('features_ignored_orphans', $ignored_orphans);
+    $form_state['redirect'] = 'admin/structure/features/cleanup';
   }
-  $form_state['redirect'] = 'admin/structure/features/cleanup';
 }
 
 /**
