Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    1

    Default security php fopen chmod 777

    Hi

    If using php in a cPanel account the only way I can write to a file is to CHMOD as writable to everybody . I would have thought this is a security issue, enabling anyone to write to that file. Can someone please clarify? I have read somwhere that for some reason this is still secure, but I question that.

    eg
    $fileH = fopen("/home/path/to/file","w");
    comes up with
    Warning: fopen(/home/path/to/file): failed to open stream: Permission denied in /home/path/to/file on line 2
    unless CHMOD xx6 or xx7

    Many Thanks
    Sky

  2. #2
    sv1
    sv1 is offline
    Member
    Join Date
    Aug 2003
    Posts
    140

    Default

    We have an issue on a server which we upgraded php and after running /scripts/convert2maildir

    Warning: fopen(/tmp/horde_32001.log): failed to open stream: Permission denied in /usr/local/cpanel/3rdparty/lib/php/Log/file.php on line 202

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/3rdparty/lib/php/Log/file.php:202) in /usr/local/cpanel/base/horde/login.php on line 96

  3. #3
    Member sh4ka's Avatar
    Join Date
    May 2005
    Posts
    433

    Default

    first try chmod 755 and if that doesn't work temporary you will have to chmod 777 that file until you resolve the problems, and yeap, it's kind unsure 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

    Quote Originally Posted by sv1
    We have an issue on a server which we upgraded php and after running /scripts/convert2maildir

    Warning: fopen(/tmp/horde_32001.log): failed to open stream: Permission denied in /usr/local/cpanel/3rdparty/lib/php/Log/file.php on line 202

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cpanel/3rdparty/lib/php/Log/file.php:202) in /usr/local/cpanel/base/horde/login.php on line 96
    Just delete the /tmp/horde_32001.log file and it should recreate itself with the correct ownership. Also, do make sure that /tmp is chmod 1777.

    If using php in a cPanel account the only way I can write to a file is to CHMOD as writable to everybody . I would have thought this is a security issue, enabling anyone to write to that file. Can someone please clarify? I have read somwhere that for some reason this is still secure, but I question that.
    Yup, welcome to the crap php security model. Oh wait, it doesn't have one. If you want to avoid that you'd have to rebuild apache with phpsuexec enabled.
    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. Chmod 777 is disabled - how to enable
    By khorinis in forum New User Questions
    Replies: 1
    Last Post: 09-06-2010, 10:31 AM
  2. block users from chmod 777
    By merlinpa1969 in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 08-05-2007, 08:46 PM
  3. chmod 777 on folders
    By sayouly in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 09-29-2005, 03:45 AM
  4. chmod 777
    By HH-Steven in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 01-15-2005, 05:32 AM
  5. PHP 4.3.2 & fopen()
    By ukhost in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 10-13-2003, 07:45 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube