Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member equens's Avatar
    Join Date
    Feb 2002
    Posts
    256

    Default Security hole?

    I have test this function in one domain and I can see the sessions contents for all domains. How can I prevent this?

    PHP Code:

    function f_ls(){
           
    $command "ls -1 /tmp/sess_*";
           if (
    $proc popen("($command)2>&1","r")) {
                   while (!
    feof($proc)) $contents .= fgets($proc1000);
           }
           
    pclose($proc);
           return 
    explode("\n",$contents);


  2. #2
    Member
    Join Date
    Mar 2004
    Location
    Ayr, North Queensland, Australia
    Posts
    328

    Default

    use php safemode or disable certain functions.

    Regards,
    Brent

    Talk at cPanel IRC
    cPanel IRC Logs (Publicly available) @ My Site

  3. #3
    Member equens's Avatar
    Join Date
    Feb 2002
    Posts
    256

    Default disable_functions

    Ok... implemented disable_functions with popen.

    disable_functions =dl,exec,passthru,popen,shell_exec,system

    I think is more secure now but safemode will be the best solution.
    Thanks!

  4. #4
    Member equens's Avatar
    Join Date
    Feb 2002
    Posts
    256

    Default

    How can I search in /home directory php files with this function? I want to know how many people will have problems after disable this function in php. Thanks!

  5. #5
    Member equens's Avatar
    Join Date
    Feb 2002
    Posts
    256

    Default open_basedir Protection

    Hello again, why the php open_basedir Protection doesn't prevents users from opening files outside of their home directory with php like /tmp??

  6. #6
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Because you need to be able to access temporary files from php scripts. The problem you're seeing is a result of running php without phpsuexec enabled and all sessions are owned by the nobody user. The safest way to prevent this type of access is to use phpsuexec, though it may break some scripts. Then it's up to you to trade-off security with usability. All my servers always have phpsuexec enabled and customers have to work around it.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

Similar Threads & Tags
Similar threads

  1. Security Hole/Bug?
    By LH-Richard in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-24-2006, 07:06 AM
  2. Replies: 109
    Last Post: 06-22-2004, 07:39 PM
  3. Security hole!!
    By Getox in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 05-01-2004, 01:33 PM
  4. IE security hole
    By bdraco in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-05-2002, 08:06 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube