PHP 5.1.6 / 4.4.4 Critical php_admin* Bypass by ini_restore()
ini_restore関数を使うと、PHPオプションのlocal value(httpd.confや.htaccessで設定した値)がmaster value(php.iniの値)で上書きされてしまう、ということらしいです。
php_admin_value and php_admin_flag Bypass
When using PHP as an Apache module, you can also change the configuration settings using directives in Apache configuration files (e.g. httpd.conf). This options are using by a lot of ISP to set open_basedir, safe_mode and more options.
:
If you have safe_mode or open_basedir (etc) set in Local Value for selected users and in Master Value is default value, you can restore Master Value to Local Value per ini_restore() function!
手元にあるApache2.2.3+PHP5.1.6で確認しましたが、/etc/passwdが表示されてしまいました。確かに、ini_restoreするとphp.iniの値に戻ってしまいました。
個人的にはSIでPHPを使う場合はphp.iniに設定してしまいますが、OSSなアプリケーションなどでスクリプト側でiniの値を書き換えている場合、かつ、ini_restore関数を使っている場合は注意する必要があるかも知れませんね。