Skip to main content

Running litespeed as cPanel user - security issue?

Comments

5 comments

  • Henry Carter
    Hi, On Cpanel servers, if we enable PHP suEXEC for shared hosting (each user has their own account uid/gid). then no need to chown. Do you host more sites on this user account "nonyabid" ?
    0
  • midwestE
    Hi, On Cpanel servers, if we enable PHP suEXEC for shared hosting (each user has their own account uid/gid). then no need to chown. Do you host more sites on this user account "nonyabid" ?

    There will be more sites on this account, currently though there is only one. The problem comes from the fact that running the webserver as the user that owns the files presents an issue. Say for instance that a drupal module has a security flaw that allows a anonymous user to exploit the code and write files to webroot (or subdirectories). This allows the anonymous user to write files into the web directory that can allow them to execute code that was uploaded to give them even more access or compromise the files/data. To prevent this, the web server should never be able to have permission to write files to the webroot. Then, even if a code exploit exists, the webserver can't write files to the codebase.
    0
  • midwestE
    I think this issue could be solved by making the web server run as the group owner, then giving -rw-r--r-- would allow the user to modify, and the group could not
    0
  • LitespeedLucas
    Hi @midwestE When you install LiteSpeed on a cPanel server it will be installed to match the user:group nobody:nobody
    . You can easily verify this by going into your LiteSpeed Web Console (port :7080
    ), then go to Configuration -> Server -> General - here you'll see "Running As" under the "Server Process" section. On the same page, you'll also have a section called "Using Apache Configuration File" section, here you'll see "PHP suEXEC", this is likely set to "Yes" - if that's the case, then PHP processes spawned by the webserver will be running under suexec, so using the user:group of the given VirtualHost (matching the cPanel user owning the domain) - you can check the user:group that will be used in the /etc/apache2/conf/httpd.conf
    , the suexec setting you'll be looking for is SuexecUserGroup
    . From a file-ownership perspective, you'd want to run 755 for directories and 644 for files, for example, this is perfectly secure.
    0
  • cPanelLauren
    Thanks @LitespeedLucas for the the explanation. @midwestE let us know if you have any further questions/concerns.
    0

Please sign in to leave a comment.