Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    427

    Default Open_Basedir, trailing slash after /tmp - will it stop creating directories ?

    I have a problem with exploits in scripts that uploads stuff to the tmp directoy
    and run them there. It's different kinds of activites but non is welcome.

    So, finding these exploits is offcourse the best way to fix it but as a security
    method I wonder if adding a trailing slash / after the tmp in the open_basedir lines in httpd.conf will prevent the exploit/script from making a directory in tmp ?

    As it is no it say:
    <IfModule mod_php4.c>
    php_admin_value open_basedir "/home/user/:/usr/lib/php:/usr/local/lib/php:/tmp"
    </IfModule>

    If I instead have /tmp/ in the end it should stop it from making/access anything
    under /tmp right ?

    On some servers there are a few directories in tmp but I can't see it is
    needed for php scripts. - Any idea ?

  2. #2
    Member RavenSoul_'s Avatar
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    95

    Default

    I suggest reading http://www.eth0.us/?q=tmp
    |
    Current config: SUN Fire V20z–server | WHM 10.3.1 cPanel 10.4.0-E244 | CentOS 3.5 x86_64
    |
    Current issue: none

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    427

    Default

    All of that is already done and is basicly what /scripts/securetmp is doing
    and that does not prevent scripts from running in /tmp all the time., most of the time yes,
    but if you start the script in a certain way it does not help.

    What I wanted was a way to stop php scripts from creating directories in /tmp
    and open_basedir might be way to do that.

  4. #4
    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

    AFAIK, it won't make a difference. Linux copes very well if you address directories with too many slashes, e.g.:

    ls -la //var//log//

    The only realistic way to to fix the problem php scripts in the first place and use a good set of mod_security secfilters.
    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. cPanel Redirect Adds Trailing Slash
    By aaronhc in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-11-2010, 10:20 AM
  2. DOCUMENT_ROOT trailing slash
    By muppsy007 in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 03-22-2009, 07:47 PM
  3. Trailing slash issue
    By pixelsoup in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-06-2008, 09:35 PM
  4. Subdomain created directories require trailing slash?
    By royli57 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-10-2005, 02:03 AM
  5. Trailing Slash Error
    By .:RAIS:. in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-12-2004, 08:11 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube