I’m working on a site where users can create an account and upload .jpgs, .zips and .pdfs. Normally I don’t worry too much about malicious content getting uploaded as it’s the client that does the uploading—and they wouldn’t want to bring their own site down.
My question is: should I be worried about security? I’m checking the file extensions and the file headers (Content-type) but I don’t think that’s 100% secure. If someone ‘disguised’ a script as a file upload (.jpg for example) how hard would it be for the uploader to execute it? I guess even if they uploaded something they wouldn’t be able to execute it unless your PHP scripts were programmed to do so (e.g. include() uploaded files), which my site doesn’t.
I’m also uploading the files to a password protected folder (so they wouldn’t know its name or location) and then—when the user needs to access it—reading it in and specifying the appropriate file headers through a PHP script.
Is there any more that I can do other than the above? Should I be worried?