[UNIX] PHP Globals Filtering Bypass
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion
The SecuriTeam alerts list - Free, Accurate, Independent.
Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html
- - - - - - - - -
PHP Globals Filtering Bypass
------------------------------------------------------------------------
SUMMARY
Improper global parameters handling within PHP allows attackers to
overwrite existing data.
DETAILS
Vulnerable Systems:
* PHP version 4.3.10 and prior
* PHP version 5.0.5 and prior
* PHP version 5.1.1
* PHP version 5.1.2
By using a global variable in PHP attackers can overwrite the content with
it's own as following:
Proof of Concept:
foorbar.php:
< ? echo $foobar; ? >
On address bar do the following:
http://[address]/foobar.php?GLOBALS[foobar]=hello
If the poc prints out HELLO your PHP version is vulnerable.
Please note that the PHP globals must be on in order to be vulnerable.
Workaround:
Register global off will fix. This PHP code will mitigate this bug.
// put this code before everything
if (isset($HTTP_POST_VARS['GLOBALS']) || isset($_POST['GLOBALS']) ||
isset($HTTP_POST_FILES['GLOBALS']) || isset($_FILES['GLOBALS']) ||
isset($HTTP_GET_VARS['GLOBALS']) || isset($_GET['GLOBALS']) ||
isset($HTTP_COOKIE_VARS['GLOBALS']) || isset($_COOKIE['GLOBALS'])) {
trigger_error('Is this a GLOBAL GPC hacking attemp?', E_USER_ERROR);
}
Disclosure Timeline:
20060119 Bug discovered
20060119 Internal release
20060125 Initial release (only on ush.it)
20060127 Initial release (only on sikurezza.org)
20060128 Public release
ADDITIONAL INFORMATION
The information has been provided by <mailto:ascii@xxxxxxxxxxxx> ascii.
The original article can be found at:
<http://www.ush.it/2006/01/25/php5-globals-vulnerability/>
http://www.ush.it/2006/01/25/php5-globals-vulnerability/
========================================
This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@xxxxxxxxxxxxxx
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@xxxxxxxxxxxxxx
====================
====================
DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.
Relevant Pages
- [UNIX] PHP Multiple Vulnerabilities (File Upload, parse_str() register_global bypassing, phpinfo XSS
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... array of PHP allowing attackers
to inject different content to PHP global ... File-Upload $GLOBALS Overwrite: ...
sending a multipart/form-data POST request containing a fileupload field ... (Securiteam) - [UNIX] Multiple Vulnerabilities within PHP 4/5 (pack, unpack, safe_mode_exec_dir, safe_mode, realpat
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... PHP is "a widely-used general-purpose
scripting language that is ... several vulnerabilities within PHP were ... unserialize()
- Wrong Handling of Negative References ... (Securiteam) - [UNIX] Dotdeb PHP Email Header Injection Vulnerability
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... Dotdeb PHP Email Header Injection
Vulnerability ... This patch adds an X-PHP-Script header to ... (Securiteam) - [NEWS] PHP getimagesize() Multiple DoS Vulnerabilities
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... PHP is a widely-used general-purpose
scripting language that is especially ... Remote exploitation of a denial of service condition
in the PHP ... Local exploitation of an input validation vulnerability in The PHP Group's
... (Securiteam) - [UNIX] PHP 5.1.6 / 4.4.4 Critical php_admin* Bypass by ini_restore()
... The following security advisory is sent to the securiteam mailing list, and can be
found at the SecuriTeam web site: http://www.securiteam.com ... There is a privilage escalation
vulnerability in PHP. ... Used to set a boolean configuration directive. ...
can not be overridden by .htaccess or virtualhost directives. ... (Securiteam)