Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm wondering whether my architecture poses a security risk. Details:

  • The whole website is not ROOT owned but still, the APACHE user used instead has some pretty advanced permissions.

  • I have a folder "user_files" that may hold any kind of user files. For example, a ksh unix file.

  • My php.ini disables the exec php function (as well as some other sensitive functions)

My question is simple yet bears 2 aspects:

  1. could somebody execute the uploaded script?
  2. what is the magnitude of the risk? If the script is executed by apache I guess the maximum it could do is to delete all apache owned files of the server, right?
share|improve this question

1 Answer 1

up vote 2 down vote accepted

You disabling php's exec functions may help lock down php scripts from calling other scripts, such as the ksh script you describe. However, unless you disable users being able to upload php scripts, they could call damaging functions from php ( unless you disabled ALL of those too ).

If you can disable all dynamic scripts from being interpreted by apache for the users_files directory, you may be safer, but disable some of the functionality you desire for your users.

Depending on your distribution, and software you feel like installing and maintaing, I can think of one options.

Enable Apache's suEXEC features, so any non php, and other mod_language scripts run under another user account. Using php via a cgi interface, which if you can get php-fpm, would make running certain scripts as a separate user easier.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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