Hangover2
Regular Pleskian
Username:
TITLE
Disabled PHP "Hosting performance settings management" can be bypassed by using .user.ini or ini_set()
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Plesk Obsidian 18.0.61 Update #6, Debian 12.6, x86-64
PROBLEM DESCRIPTION
Even though we disallow the usage of adjusting the per-site PHP performance settings in our service plans, the clients can easily overstep that restriction by using a
STEPS TO REPRODUCE
- Create a service plan and disable the permission for "Hosting performance settings management (Allows to adjust performance settings: Per-site PHP performance settings.)".
- Set some default PHP settings for performance and security in the service plan, e.g.:
memory_limit 512M
max_execution_time 60
- Create a subscription with this service plan.
- Create the file
- Create the file
- Open the website of the newly created subscription and check the output of
- Instead of using the
ACTUAL RESULT
- memory_limit is now 2048M
- max_execution_time is now 240
EXPECTED RESULT
- memory_limit should still be 512M
- max_execution_time should still be 60
ANY ADDITIONAL INFORMATION
This is a follow-up bug report from this discussion:
Disabled "Hosting performance settings management" is ignored when using .user.ini
In our case (dedicated PHP-FPM) a possible solution would be to use
Instead of the current implementation:
Disabling the
Right now the whole feature has no real effect other than just disabling the graphical user interface in the admin panel. I think many Plesk users believe, that this feature protects them from over usage of server resources by their clients. But this is not the case. If this is an intended behavior, please fix the description in the service plans area. In that case please help sorting out, how we can restrict the server resources for use case mentioned. Shared hosting packages depend highly on that values concerning the package price and they should not be changeable by the clients.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug
TITLE
Disabled PHP "Hosting performance settings management" can be bypassed by using .user.ini or ini_set()
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE
Plesk Obsidian 18.0.61 Update #6, Debian 12.6, x86-64
PROBLEM DESCRIPTION
Even though we disallow the usage of adjusting the per-site PHP performance settings in our service plans, the clients can easily overstep that restriction by using a
.user.ini
settings file or the PHP command ini_set()
.STEPS TO REPRODUCE
- Create a service plan and disable the permission for "Hosting performance settings management (Allows to adjust performance settings: Per-site PHP performance settings.)".
- Set some default PHP settings for performance and security in the service plan, e.g.:
memory_limit 512M
max_execution_time 60
- Create a subscription with this service plan.
- Create the file
.user.ini
inside the document root with the following content:
Code:
memory_limit = 2048M
max_execution_time = 240
index.php
inside the document root with the following content:
PHP:
<?php
phpinfo();
phpinfo()
concerning the values of memory_limit
and max_execution_time
.- Instead of using the
.user.ini
file, you can also just put a single index.php
file with the following content in the document root:
PHP:
<?php
ini_set('memory_limit', '2048M');
ini_set('max_execution_time', '240');
phpinfo();
ACTUAL RESULT
- memory_limit is now 2048M
- max_execution_time is now 240
EXPECTED RESULT
- memory_limit should still be 512M
- max_execution_time should still be 60
ANY ADDITIONAL INFORMATION
This is a follow-up bug report from this discussion:
Disabled "Hosting performance settings management" is ignored when using .user.ini
In our case (dedicated PHP-FPM) a possible solution would be to use
php_admin_value()
for all performance and security settings when the permission to change them is not granted by the service plan in /var/www/vhosts/system/domain.example/etc/php-fpm.conf
e.g.:
Code:
php_admin_value[memory_limit] = 512M
Code:
php_value[memory_limit] = 512M
Disabling the
.user.ini
settings file or the PHP command ini_set()
is no real option and would have too many side effects on our clients. The php_admin_value
implementation seems to be the more suitable way.Right now the whole feature has no real effect other than just disabling the graphical user interface in the admin panel. I think many Plesk users believe, that this feature protects them from over usage of server resources by their clients. But this is not the case. If this is an intended behavior, please fix the description in the service plans area. In that case please help sorting out, how we can restrict the server resources for use case mentioned. Shared hosting packages depend highly on that values concerning the package price and they should not be changeable by the clients.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM
Confirm bug