Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 299229

Ajax file upload callback improperly checks view published content ('access content') permission

$
0
0

Drupal should not check to see if a user has permission to view published nodes when they are uploading a managed file. That file could be on a term, a user, or anywhere else in the Drupal system - having nothing at all to do with viewing content that has been published.

In the file module, the AJAX callbacks look like this.

  $items['file/ajax'] = array(
    'page callback' => 'file_ajax_upload',
    'delivery callback' => 'ajax_deliver',
    'access arguments' => array('access content'),
    'theme callback' => 'ajax_base_page_theme',
    'type' => MENU_CALLBACK,
  );
  $items['file/progress'] = array(
    'page callback' => 'file_ajax_progress',
    'access arguments' => array('access content'),
    'theme callback' => 'ajax_base_page_theme',
    'type' => MENU_CALLBACK,
  );

They need to look like this instead:
  $items['file/ajax'] = array(
    'page callback' => 'file_ajax_upload',
    'delivery callback' => 'ajax_deliver',
    'access callback' => TRUE,
    'theme callback' => 'ajax_base_page_theme',
    'type' => MENU_CALLBACK,
  );
  $items['file/progress'] = array(
    'page callback' => 'file_ajax_progress',
    'access callback' => TRUE,
    'theme callback' => 'ajax_base_page_theme',
    'type' => MENU_CALLBACK,
  );

If we are using file entities in Drupal 8 then this bug is limited to Drupal 7.

Related:
#1368610: Users must have permission to "view published content" in order to create a node of any type.

AttachmentSizeStatusTest resultOperations
drupal-file_ajax_improperly_checks_access.patch740 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 39,928 pass(es).View details | Re-test

Viewing all articles
Browse latest Browse all 299229

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>