PHP versions 5.4.40, 5.5.24, and 5.6.8 provide a fix for type confusion vulnerability in unserialize() function used on a various SOAP methods. Copy-paste description of the issue from the upstream bug: """ PHP_METHOD(SoapFault, __toString) { ... faultcode = zend_read_property(soap_fault_class_entry, this_ptr, "faultcode", sizeof("faultcode")-1, 1 TSRMLS_CC); faultstring = zend_read_property(soap_fault_class_entry, this_ptr, "faultstring", sizeof("faultstring")-1, 1 TSRMLS_CC); file = zend_read_property(soap_fault_class_entry, this_ptr, "file", sizeof("file")-1, 1 TSRMLS_CC); line = zend_read_property(soap_fault_class_entry, this_ptr, "line", sizeof("line")-1, 1 TSRMLS_CC); ... len = spprintf(&str, 0, "SoapFault exception: [%s] %s in %s:%ld\nStack trace:\n%s", Z_STRVAL_P(faultcode), Z_STRVAL_P(faultstring), Z_STRVAL_P(file), Z_LVAL_P(line), Z_STRLEN_P(trace) ? Z_STRVAL_P(trace) : "#0 {main}\n"); zval_ptr_dtor(&trace); RETURN_STRINGL(str, len, 0); } The Z_STRVAL_P macro lead to looking up an arbitrary valid memory address, and return a string via a integer-type zval that start from this memory address. If the memory address is an invalid memory position, it should result in a crash. The Z_LVAL_P macro lead to leaking memory address via a string-type zval that string value stored. The following code should leak arbitrary memory or crash PHP: <?php $data = 'O:9:"SoapFault":4:{s:9:"faultcode";i:4298448493;s:11:"faultstring";i:4298448543;s:7:"'."\0*\0".'file";i:4298447319;s:7:"'."\0*\0".'line";s:4:"ryat";}'; echo unserialize($data); ?> Result (Test on standard MacOSX 10.10.2 installation of PHP 5.6.6.): SoapFault exception: [UH??AWAVSPI??I??H???? in UH??AWAVAUATSH???:4307253992 ] UH??SPD???*?????t"H? Stack trace: #0 test.php(4): unserialize('O:9:"SoapFault"...') #1 {main} """ Upstream bug: https://bugs.php.net/bug.php?id=69152 Upstream commits: http://git.php.net/?p=php-src.git;a=commitdiff;h=0c136a2abd49298b66acb0cad504f0f972f5bfe8 http://git.php.net/?p=php-src.git;a=commitdiff;h=51856a76f87ecb24fe1385342be43610fb6c86e4 http://git.php.net/?p=php-src.git;a=commitdiff;h=fb83c76deec58f1fab17c350f04c9f042e5977d1
In addition to commits mentioned in comment 0, there is additional commit: http://git.php.net/?p=php-src.git;a=commitdiff;h=a894a8155fab068d68a04bf181dbaddfa01ccbb0 to address the issue mentioned in the following comment of the upstream bug: https://bugs.php.net/bug.php?id=69152#1427277435
Multiple CVEs were assigned for the fixes mentioned in the bug, see: http://seclists.org/oss-sec/2015/q2/727 CVE-2015-4599 was assigned for the original SoapFault::__toString issue reported in the upstream bug: https://bugs.php.net/bug.php?id=69152#1425215948 and corrected in: http://git.php.net/?p=php-src.git;a=commitdiff;h=51856a76f87ecb24fe1385342be43610fb6c86e4 CVE-2015-4600 was assigned for the SoapClient::__getLastRequest, SoapClient::__getLastResponse, SoapClient::__getLastRequestHeaders, SoapClient::__getLastResponseHeaders, SoapClient::__getCookies, and SoapClient::__setCookie issue described in the following comments of the upstream bug: https://bugs.php.net/bug.php?id=69152#1425271419 https://bugs.php.net/bug.php?id=69152#1425271913 and corrected in: http://git.php.net/?p=php-src.git;a=commitdiff;h=0c136a2abd49298b66acb0cad504f0f972f5bfe8 CVE-2015-4601 was assigned for the other fixes applied as part of upstream commit 0c136a2a. CVE-2015-4602 was assigned for the incomplete class type confusion issue reported in: https://bugs.php.net/bug.php?id=69152#1426863482 and corrected in: http://git.php.net/?p=php-src.git;a=commitdiff;h=fb83c76deec58f1fab17c350f04c9f042e5977d1 CVE-2015-4603 was assigned for the exception::getTraceAsString() issue reported in: https://bugs.php.net/bug.php?id=69152#1425357025 and corrected in: http://git.php.net/?p=php-src.git;a=commitdiff;h=a894a8155fab068d68a04bf181dbaddfa01ccbb0
CVE-2015-4599, CVE-2015-4600, and CVE-2015-4601 issues were already corrected in Red Hat Software Collections updates in 2.0: php54: https://rhn.redhat.com/errata/RHSA-2015-1066.html php55: https://rhn.redhat.com/errata/RHSA-2015-1053.html as part of the fixes for CVE-2015-4147 (bug 1204868) / CVE-2015-4148 (bug 1226916). The rh-php56 collection packages introduced via RHEA-2015:1057 had these issues corrected since the initial release: rh-php56: https://rhn.redhat.com/errata/RHEA-2015-1057.html
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2015:1135 https://rhn.redhat.com/errata/RHSA-2015-1135.html
This issue has been addressed in the following products: Red Hat Enterprise Linux 6 Via RHSA-2015:1218 https://rhn.redhat.com/errata/RHSA-2015-1218.html