Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 37
  1. #1
    Member
    Join Date
    Apr 2005
    Posts
    142

    Default open_basedir not working - help!

    I've just noticed that my open_basedir protection is not working, and I am able to include other users file's on my server!

    open_basedir is enabled in cPanel, and I verified that by looking in httpd.conf - this is what is in there (for one of the users):

    ServerAlias auscong.com
    ServerAdmin webmaster@auscong.com
    DocumentRoot /home/auscong/public_html
    BytesLog domlogs/auscong.com-bytes_log
    User auscong
    Group auscong
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/auscong/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    <IfModule mod_php5.c>
    php_admin_value open_basedir "/home/auscong/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>
    ServerName www.auscong.com
    As you can see, open_basedir *is enabled*. But I'm still able to include other users file's. Am I missing something obvious here or is open_basedir not working?

    Thanks

  2. #2
    Member
    Join Date
    Sep 2006
    Posts
    73

    Default

    Try
    # /scripts/phpopenbasectl off
    # /scripts/phpopenbasectl on
    # /scripts/restartsrv_apache

  3. #3
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    open_basedir isn`t effective. I saw the effect too. It won`t allow users to browse under /home/, but in /home/ it allows it. I`m switching to suPHP.

  4. #4
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by bin_asc View Post
    open_basedir isn`t effective. I saw the effect too. It won`t allow users to browse under /home/, but in /home/ it allows it. I`m switching to suPHP.
    Could you expound on that please? It's possible we are missing something, but I'm not fully understanding your statement above.

  5. #5
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    openbase_dir is enabled on my server, but thing is that it keeps shell scripts from going under /home/, like /, or /root and so on, but it allows users to browse other /home/user/ directories.

  6. #6
    Member
    Join Date
    Apr 2005
    Posts
    142

    Default

    Quote Originally Posted by linux.newbie View Post
    Try
    # /scripts/phpopenbasectl off
    # /scripts/phpopenbasectl on
    # /scripts/restartsrv_apache
    Nope, still doesn't work.

    Am I doing something wrong or is there a bug somewhere here that is causing a massive security hole? Should others be checking to make sure their open_basedir is working correctly?

  7. #7
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    Hoefully Kenneth will be able to give us some information.

  8. #8
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    By which means are they browsing:

    1. www.WHM_HOSTNAME/~username
    2. www.CPANEL_HOSTNAME/~username
    3. http://ip.add.res.s/~username

    Also, are you using mod_php, PHP CGI, suExec?

    By browsing, do you mean with an actual web browser, or via PHP (e.g. using Curl, include, etc)?

    Yeah - all that sounds pedantic, but it helps me determine what tests to run and explanations to fetch.

  9. #9
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    Well, I was refering to shell scripts. A shell c99 script or r57 ... I can send you some shell scripts, if you want to try.

  10. #10
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    Steps to reproduce :
    Enable openbase_dir on all ( some ) accounts. Create a new account in WHM. Make sure openbase_dir is enabled for it. Upload a shell script ( like I said, I can provide one ). Start browsing other users /home/user/ files ....

  11. #11
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2003
    Location
    moscow
    Posts
    294

    Default

    coudn't be more easy just run php script with phpinfo() inside in any /home/username/public_html and got same result? if you check openbase value in his output you will see that it is not set (if you do not set it in server php.ini). Cannot confirm for php module, but for suphp i can.
    https://robobill.net
    US dedicated, Europe and Asia and Russia dedicated server. Shared, Reseller, VPS hosting in US and Europe.
    We are RESELLER of dedicated servers since 2002.

  12. #12
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    It`s not the debate of whether it`s on or off, it`s that it doesn`t do what it is supposed to do.

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2003
    Location
    moscow
    Posts
    294

    Default

    I woudn't like debate, i am only prefer easy way for realizing any things. At least in situation where it possible.
    if someone ask me why it not work i would say that it happen because when you use suphp you should place php directives only and only in php.ini file inside user home directory where you would like change something. Placing php directives in virtual hosts section will be ignored.
    https://robobill.net
    US dedicated, Europe and Asia and Russia dedicated server. Shared, Reseller, VPS hosting in US and Europe.
    We are RESELLER of dedicated servers since 2002.

  14. #14
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    I`m not using suPHP, and neither is the other fella. If I were, I wouldn`t need openbase_dir.

  15. #15
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Nov 2003
    Location
    moscow
    Posts
    294

    Default

    I don't know what version of apache/php you use, but for case: apache 1.3.xxx/php5.2.xxx probably it should work if you edit your virtualhost section like this:

    ServerAlias auscong.com
    ServerAdmin webmaster@auscong.com
    DocumentRoot /home/auscong/public_html
    BytesLog domlogs/auscong.com-bytes_log
    User auscong
    Group auscong
    php_admin_value open_basedir "/home/auscong/:/usr/lib/php:/usr/local/lib/php:/tmp"
    https://robobill.net
    US dedicated, Europe and Asia and Russia dedicated server. Shared, Reseller, VPS hosting in US and Europe.
    We are RESELLER of dedicated servers since 2002.

Similar Threads & Tags
Similar threads

  1. open_basedir restriction not working for HTTPS
    By Maleas in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-26-2008, 08:19 AM
  2. open_basedir with phpsuexec - not working?
    By anton_latvia in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-06-2006, 09:53 AM
  3. php open_basedir not working
    By AashX in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-23-2006, 06:20 AM
  4. php open_basedir Protection not working???
    By Weed in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 02-13-2004, 10:45 PM
  5. Tweak Security: PHP Open_basedir Not Working
    By mmkassem in forum cPanel and WHM Discussions
    Replies: 12
    Last Post: 08-09-2003, 08:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube