We recently got our servers into SVN which has been great, but this causes a lot of problems when using things like WP Filebase for CMS file management. It's also hard to keep the uploads folder synced, so we would like to turn off SVN for select directories. This leads me to the question at hand:

If we disallow a file type (php) in certain directories and someone uploads a shell script disguised as a .jpg or other file type that unpacks itself into a .php file, will that file actually unpack? Or will it unpack and just not execute? I'm not sure how folder security/permissions options work at this level.

Currently using IIS, though will likely be moving to a linux box soon.

  • What do you mean by "turn off SVN for select directories"? Just add an svnignore rule and don't check them in... Oct 5 '13 at 2:01

The server should not execute a '.jpg' file with PHP as the content-types are mapped by file extension in IIS and thus it cannot 'unpack itself'.

So by default it would just serve the raw content of the .jpg file with the mime header 'image/jpeg' and your browser will just complain that it cannot render the image.

  • Shouldn't, yes. But I've seen videos online of hackers using image extensions to upload a file, then having it execute a script giving them access to the machines. I'm not going to pretend I know how it works, but I've seen it so am trying to protect against it... well... was. I'm not longer on this project so can't move forward on it anymore. Oct 17 '13 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.