#1
|
|||
|
phUploader File Upload Vulnerability
I noticed this phUploader security issue at: SecurityFocus.
Below is a summary from: SecurityFocusArchives : Quote:
Great script, keep up the good work! |
#2
|
||
|
It's not really a vunerability but rather an annoyance. If someone uploads a file with a special character you may not be able to delete it though FTP. Make sure you set file extensions to exclude file types that are prone to cause attacks suchs as exe, src etc as the script cannot tell if the file is an exploit. It may also be helpfull to run a virus scanner in the background like you shoud be doing on a server anyways.
To fix it do this: After (line 185): PHP Code:
PHP Code:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq Last edited by Scott; 05-25-2008 at 06:14 PM. |
#3
|
||
|
Sweet! I will do that! Thanks for the speedy reply.
|
#4
|
||
|
I added the suggested code but encountered an error from the "\" section, which I replaced with "\\" to escape the escape character and avoid the error missing the double quote.
Then I reduced the code to test just file names with spaces, since I really need this feature... My sanitize line is now: $sanatize = array(" "); This was very easy to test by uploading file names with spaces. The program completed but it did not remove the spaces in the uploaded file names. Any ideas why? Can you verify this? Thanks! |
#5
|
||
|
Oops, I forgot to mention that the "random_name" variable is set to false, so the code will be executed in the "Else" clause.
|
#6
|
||
|
Sorry, I didn't test the above code before posting it as I was in a rush. I throughly tested this and it works. Remove any previous changes.
Replace: PHP Code:
PHP Code:
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
#7
|
|||
|
The new code will throw an error (see below), I think due to the back slash cancels the double quote (see fix below). However, I was not able to test my changes in the code.
It worked like a charm after the above change. I was able to test uploading a file with spaces and they were removed as expected. Thanks for your effort! Quote:
|
#8
|
||
|
Weird!! it's the forums software that was removing my double back slash.. I knew I tested that code right before I posted it.
Glad it worked for you
__________________
04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
incorporate php file upload with MySQL form? | pauldridge | Tech Support | 1 | 06-16-2010 08:46 AM |
Send Email with Attachment from the File Upload | ronieperez | phphq.Net Forums | 2 | 10-24-2008 07:14 PM |
phUploader can erase file? | chrbar | phphq.Net Forums | 3 | 09-06-2008 05:05 PM |
Form verify phUploader so they MUST upload? | Lex | phphq.Net Forums | 1 | 08-27-2007 06:13 PM |
Microsoft Confirms WMF Vulnerability | zaitsev | Hardware and Software | 0 | 01-02-2006 10:04 AM |