Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Jul 2003
    Posts
    5

    Default question on php security

    I've FreeBSD machine with Apache + php in suexec mode.

    Now, each php script works with privileges of right user and It working correctly.

    I've one problem. Users can look into system directories and files, like /etc/passwd. How to protect it? For some reasons, I don't want allow users to look into other places than their account.

    How to do it?

    I must have safe_mode disabled.

    Thanks for help

    cPanel.net Support Ticket Number:

  2. #2
    Member
    Join Date
    Mar 2003
    Location
    Dallas, TX
    Posts
    45

    Default

    At least the Linux version has an option to enable the PHP option open_basedir for each virtual host in the "Tweak Security" section. Even if it's not there, you can add it to your httpd.conf.

    This prohibits PHP scripts from reading from or writing to a file outside of the directories listed in the open_basedir setting.

    It is much more flexible solution than safe mode.

    cPanel.net Support Ticket Number:

  3. #3
    Member
    Join Date
    Jul 2003
    Posts
    5

    Default

    Originally posted by cortices
    [B]At least the Linux version has an option to enable the PHP option open_basedir for each virtual host in the "Tweak Security" section. Even if it's not there, you can add it to your httpd.conf.
    Not. I can't do it in this way, because php is working as cgi not as apache module. And it not depend on my OS.

    Any other ideas?

    Jarek

    cPanel.net Support Ticket Number:

  4. #4
    Member munk's Avatar
    Join Date
    Sep 2003
    Posts
    24

    Default

    Out of interest how did you setup apache+php with suexec on FreeBSD?

    cPanel.net Support Ticket Number:

  5. #5
    Member
    Join Date
    Jul 2003
    Posts
    5

    Default

    Originally posted by munk
    Out of interest how did you setup apache+php with suexec on FreeBSD?

    /scripts/easyapache or Apache Update in WHM. Works well. PHP is working as CGI, not as mod_php4.so.

    cPanel.net Support Ticket Number:

  6. #6
    Member munk's Avatar
    Join Date
    Sep 2003
    Posts
    24

    Default

    Ah right thanks for the tip. This is something we need to consider as well since bounces from CGI scripts always come back to the user apache is running as which is highly annoying.

    Sorry I can't help right now Perhaps a jail/chroot solution to lock users into their home directories?

    cPanel.net Support Ticket Number:

Similar Threads & Tags
Similar threads

  1. Apache / PHP user security question
    By whl02 in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 03-29-2010, 02:45 PM
  2. Question about PHP security, setting up multiple php.ini files?
    By sirbrent in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-01-2008, 10:58 AM
  3. Simple security question about mod-security rule sets.
    By jols in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-09-2007, 04:37 AM
  4. PHP suEXEC Support security question
    By equens in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 06-11-2004, 01:16 PM
  5. Is PHP Updated? SECURITY HOLE IN PHP
    By cazzy123 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-11-2002, 04:15 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube