helpSavannah Administration - Support: sr #109422, Temporary upload...

 
 

sr #109422: Temporary upload (/register/upload.php) can overwrite another user's file if filename is the same

Submitted by:  Dom Walden <drw>
Submitted on:  Mon 27 Nov 2017 08:36:16 PM UTC  
 
Category: Savannah trackers - bugs, tasks, etc.Priority: 5 - Normal
Severity: 6 - SecurityStatus: None
Assigned to: NoneOperating System: GNU/Linux
Open/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 27 Nov 2017 08:36:16 PM UTC, original submission:

Problem

Uploading a file via /register/upload.php will overwrite a file of the same name in $GLOBALS['sys_upload_dir'] (on mine /var/www/submissions_uploads/).

I have reproduced this on my system (details below) with two different users, each uploading a file with the same filename but different contents. I checked that the file's size and contents in /var/www/submissions_uploads/ had changed between the two uploads.

Potential Solutions

Checking online, PHP's move_uploaded_file() apparently will overwrite files. Perhaps check whether a file already exists of the same name, and change the name of the newly uploaded file (perhaps add a unique identifier). Inform the user of the changed filename (obviously).

My System and Savane Version

savane version: git commit af1d2bb2918e48bc1d8c5df244872566f9f81ec7 (Thu Sep 28 10:54:57 2017 +0000)

I am running savane in a docker (version 1.6.2) container on my Debian Jessie machine. The docker container is based on a Debian Jessie image. Otherwise, setup was taken from https://savannah.gnu.org/maintenance/RunningSavaneLocally/ (my MySQL server runs on another local docker container).

Dom Walden <drw>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by drw (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1