php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72253 phpinfo shows only first block of admin_value[disable_functions]
Submitted: 2016-05-22 20:45 UTC Modified: 2016-06-05 04:45 UTC
From: witekfl at gazeta dot pl Assigned:
Status: Open Package: FPM related
PHP Version: 7.0.6 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: witekfl at gazeta dot pl
New email:
PHP Version: OS:

 

 [2016-05-22 20:45 UTC] witekfl at gazeta dot pl
Description:
------------
phpinfo's disable_functions displays only first block of php_admin_value[disable_functions].

Test script:
---------------
php_admin_value[disable_functions] = curl_init
php_admin_value[disable_functions] = curl_close


<?php
phpinfo();

Expected result:
----------------
phpinfo in disable_functions displays curl_init, curl_close

Actual result:
--------------
curl_init

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-22 21:04 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2016-05-22 21:04 UTC] requinix@php.net
php_admin_value defines a setting that cannot be overridden. The second line is ignored because it is attempting to override the disable_function set earlier.

disable_functions is a comma-separated list of functions. Your configuration should read
  php_admin_value[disable_functions] = curl_init,curl_close

http://php.net/manual/en/ini.core.php#ini.disable-functions
 [2016-05-23 14:52 UTC] witekfl at gazeta dot pl
php_admin_value[disable_functions] = leak                                                                                                     
php_admin_value[disable_functions] = phpinfo                                                                                                  
php_admin_value[disable_functions] = exec
<?php
error_reporting(E_ALL);
phpinfo();

Warning: phpinfo() has been disabled for security reasons in /home/www/info.php on line 3

Could you check it first, please?
 [2016-05-23 17:41 UTC] fa@php.net
-Status: Not a bug +Status: Re-Opened
 [2016-05-23 17:41 UTC] fa@php.net
reproducible on 7.0.5 CLI as well:

php -n -d "disable_functions=phpinfo" -d "disable_functions=exec" -r "phpinfo();echo exec('ls');" | grep disable_

disable_functions => exec => exec
 [2016-05-23 17:43 UTC] fa@php.net
-Status: Re-Opened +Status: Not a bug
 [2016-05-23 17:43 UTC] fa@php.net
Disregard my last comment.
 [2016-05-23 19:09 UTC] requinix@php.net
-Status: Not a bug +Status: Feedback
 [2016-05-23 19:09 UTC] requinix@php.net
If you do
  php_admin_value[disable_functions]=sin
  php_admin_value[disable_functions]=cos
  php_admin_value[disable_functions]=tan
what does phpinfo() say, what does ini_get("disable_functions") return, and which of those functions do/do not work?
 [2016-05-23 19:31 UTC] witekfl at gazeta dot pl
<?php
error_reporting(E_ALL);
echo 'disable_functions=', ini_get('disable_functions'), "\n";
echo 'sin(0)=', sin(0), "\n";
echo 'cos(0)=', cos(0), "\n";
echo 'tan(0)=', tan(0), "\n";


 disable_functions=sin sin(0)=                                                                                                              
   Warning: sin() has been disabled for security reasons in /home/www/v2.6.5/info.php on line 4                                               
   cos(0)=                                                                                                                                    
   Warning: cos() has been disabled for security reasons in /home/www/v2.6.5/info.php on line 5                                               
   tan(0)=                                                                                                                                    
   Warning: tan() has been disabled for security reasons in /home/www/v2.6.5/info.php on line 6
 [2016-06-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2016-06-05 04:45 UTC] requinix@php.net
-Status: No Feedback +Status: Open
 [2019-08-28 16:39 UTC] php-bugs at lists dot php dot net
This case has been reopened as of 8/29/2019 @ 1:01AM. Please comment any new information here. Otherwise, send an email directly requinix@php.net.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 11:01:23 2020 UTC