[UNIX] PHP4 phpinfo() XSS Vulnerability (Reintroduced)



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

- - - - - - - - -



PHP4 phpinfo() XSS Vulnerability (Reintroduced)
------------------------------------------------------------------------


SUMMARY

The phpinfo() function "gives detailed information about the current
environment of PHP. This includes a dump of the request variables that
were sent".

With PHP 4.4.3 a previously fixed bug that was disclosed at the end of
October 2005 by the Hardened-PHP Project was reintroduced. Again phpinfo()
does not escape the content of user supplied arrays in GET, POST or COOKIE
variables when it displays them which leads to an XSS vulnerability.

DETAILS

Vulnerable Systems:
* PHP versions 4.4.3 to 4.4.6
* CVS version of PHP 6.0.

When the content of the request variables is printed to the user there is
a special handling for arrays that have to be printed in a recursive way.
Earlier versions of PHP did not escape them before output. This was fixed
in PHP 4.4.1. Later it turned out that due to output buffering it was
still possible to bypass the escaping. Therefore PHP nowadays passes the
write function to be used to the inner functions that are called to ensure
that the output is properly escaped. This fix was created for the PHP 5
tree and later backported to PHP 4.

Unfortunately the backport was only half and therefore the inner functions
accept the write function in the additional parameter, but do not use it
at all. This change reintroduced the vulnerability we disclosed in October
2005 back into PHP 4.4.3

To manually test for this vulnerability just call the phpinfo() page with
a parameter like this.
http://localhost/phpinfo.php?a[]=<script>alert(/XSS/);</script>


ADDITIONAL INFORMATION

The information has been provided by Hardened-PHP Project.
The original article can be found at:
<http://www.php-security.org/MOPB/MOPB-08-2007.html>
http://www.php-security.org/MOPB/MOPB-08-2007.html



========================================


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