smholsen / SoftwareSecurityExcercise

Project for the Software Security Course @ NTNU.
0 stars 0 forks source link

File Inclusion/Web Shell #11

Open Vrudin opened 7 years ago

Vrudin commented 7 years ago
smholsen commented 7 years ago

Before closing this issue we need to implement a sie check of the file. If the file is larger than 20 MB, do not allow upload.

smholsen commented 7 years ago

Do we need to check free disk space before collecting uploaded file? Will the db display errors to the user if it is attempted to upload file when not enough disk space? Note: Ask TA

keiners commented 7 years ago

checklist: https://www.owasp.org/index.php/Unrestricted_File_Upload#Prevention_Methods_.28Solutions_to_be_more_secure.29

edit: For header-check: $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($finfo, $file);

if ($mime != "application/pdf"){ $this->validationErrors[] = "Sorry, only PDF files are allowed."; }

keiners commented 7 years ago

kommenterer så noen mer php/github kompetente kan få det inn i applikasjonen: i startUpload() trenger vi while/if (file_exists($targetFile)) {endre fil-navn}