Closed (fixed)
Project:
jQuery File Upload
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2012 at 12:16 UTC
Updated:
12 Sep 2012 at 09:41 UTC
It appears this module doesn't handle:
* cross-site request forgeries to trick someone into deleting files
* user-quotas for the size of uploads and size of total uploads
* file types (e.g. that you shouldn't be able to upload php files)
* file_munge_filename to prevent more devious file extensions
It would be worth doing a thorough security review of the module prior to the 1.0 release.
Comments
Comment #1
compujohnny commentedThanks for reporting these issues, we fixed the 1st, 3rd and 4th as these are the critical ones and we will work on the 2nd
Comment #2
gregglesThanks for the quick work.
The change at http://drupalcode.org/project/jquery_file_upload.git/commitdiff/277b598?... seems insufficient since it is javascript it is client side and can be modified by the user. I suggest something server side.
The token in http://drupalcode.org/project/jquery_file_upload.git/commitdiff/da9ee62?... also feels insufficient - there should be token protection on all operations and I think the pairing of drupal_valid_token and drupal_get_token, with a seed based on the filename and operation, would be more robust.
Comment #3
compujohnny commentedConcerning the javascript change, since it's backed up by the file_munge_filename on the server side I think it will be OK,
I agree with you that the drupal_get_token approach is much better, I modified the code to use drupal_get_token and drupal_valid_token instead
Thanks for all your help :)
Comment #4
gregglesThe file_munge_filename solution seems fine, though it doesn't give feedback to the user about why the file was rejected. That feels like more of a UX issue, though.
Thanks again for the quick action!
Comment #5
compujohnny commentedThe regular user will get an error from the javascript if he tried to upload an unsupported extension
Comment #6
compujohnny commentedAdded configuration screen where file types and file sizes allowed for each user role can be configured, It supports max file size for each role, and total file quota for each role