Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15643

$phpbb_filesystem->resolve_path() may trigger open_basedir restriction

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.2.2
    • 3.3.0-b1, 3.2.9-RC1
    • None
    • PHP 7.2.4

    Description

      On a server where :

      • The forum is located at : /home/web/forum/www/
      • The open_basedir is defined to : /home/web/forum/

      The $phpbb_filesystem->resolve_path() function will try to resolve symlinks on each part of the path, like this:

      • /home
      • /home/web
      • /home/web/forum
      • /home/web/forum/www

      In this case, the first two parts are outside of the open_basedir, and will trigger the following warnings:

      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/filesystem/filesystem.php on line 838: is_link(): open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/home/web/forum/:/tmp/:/usr/share/php/:/usr/share/pear/)
       
      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/filesystem/filesystem.php on line 875: is_dir(): open_basedir restriction in effect. File(/home/) is not within the allowed path(s): (/home/web/forum/:/tmp/:/usr/share/php/:/usr/share/pear/)
       
      [phpBB Debug] PHP Warning: in file [ROOT]/phpbb/filesystem/filesystem.php on line 880: is_file(): open_basedir restriction in effect. File(/home) is not within the allowed path(s): (/home/web/forum/:/tmp/:/usr/share/php/:/usr/share/pear/)
      

      Even if this issue can be mitigated when you are on your own server (by changing or disabling the open_basedir restriction, considering that unix permissions are sufficient), this should be fixed on phpBB, because the open_basedir is used as an additional security measure by a lot of hosting providers using shared servers.

      Attachments

        Activity

          People

            Marc Marc
            Zoddo Zoddo [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: