20258327 problem in UTILITY/PHP
authorCraig Mohrman <craig.mohrman@oracle.com>
Fri, 06 Feb 2015 14:28:07 -0800
changeset 3745 9d42081739cf
parent 3744 a74b6fa1af7a
child 3746 5d7feca9a1c9
20258327 problem in UTILITY/PHP 20488612 announce PHP 5.2 EOF in man page
components/php-5_3/php-sapi/patches/220_php_20258327.patch
components/php-common/php.1.sunman
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php-5_3/php-sapi/patches/220_php_20258327.patch	Fri Feb 06 14:28:07 2015 -0800
@@ -0,0 +1,60 @@
+Fix from PHP community for CVE-2014-8142
+Bug:
+https://bugs.php.net/bug.php?id=68594
+Code:
+http://git.php.net/?p=php-src.git;a=commit;h=630f9c33c23639de85c3fd306b209b538b73b4c9
+This patch is for a newer version of php so this hand crafted equivalent
+was created for php 5.3.
+
+--- php-5.3.29/ext/standard/var_unserializer.re_orig	2014-08-13 12:22:50.000000000 -0700
++++ php-5.3.29/ext/standard/var_unserializer.re	2015-02-05 14:51:58.796366953 -0800
[email protected]@ -304,6 +304,9 @@
+ 		} else {
+ 			/* object properties should include no integers */
+ 			convert_to_string(key);
++			if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) {
++				var_push_dtor(var_hash, old_data);
++			}
+ 			zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data,
+ 					sizeof data, NULL);
+ 		}
+
+--- php-5.3.29/ext/standard/var_unserializer.c_orig	2014-08-13 12:27:30.000000000 -0700
++++ php-5.3.29/ext/standard/var_unserializer.c	2015-02-05 15:20:42.925115687 -0800
[email protected]@ -298,6 +298,9 @@
+ 		} else {
+ 			/* object properties should include no integers */
+ 			convert_to_string(key);
++			if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) {
++				var_push_dtor(var_hash, old_data);
++			}
+ 			zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data,
+ 					sizeof data, NULL);
+ 		}
+
+--- php-5.3.29/ext/standard/tests/serialize/bug68594.phpt_orig	2015-02-05 14:59:34.551069069 -0800
++++ php-5.3.29/ext/standard/tests/serialize/bug68594.phpt	2015-02-05 14:54:28.269051205 -0800
[email protected]@ -0,0 +1,23 @@
++--TEST--
++Bug #68545 Use after free vulnerability in unserialize()
++--FILE--
++<?php
++for ($i=4; $i<100; $i++) {
++	$m = new StdClass();
++
++	$u = array(1);
++
++	$m->aaa = array(1,2,&$u,4,5);
++	$m->bbb = 1;
++	$m->ccc = &$u;
++	$m->ddd = str_repeat("A", $i);
++
++	$z = serialize($m);
++	$z = str_replace("bbb", "aaa", $z);
++	$y = unserialize($z);
++	$z = serialize($y);
++}
++?>
++===DONE===
++--EXPECTF--
++===DONE===
--- a/components/php-common/php.1.sunman	Fri Feb 06 12:30:31 2015 -0800
+++ b/components/php-common/php.1.sunman	Fri Feb 06 14:28:07 2015 -0800
@@ -1,6 +1,6 @@
 '\" te
-.\" Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
-.TH php 1 "10 May 2012" "SunOS 5.11" "User Commands"
+.\" Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+.TH php 1 "29 Jan 2015" "SunOS 5.11" "User Commands"
 
 .SH "NAME"
 php \- PHP Command Line Interface
@@ -88,48 +88,82 @@
 http://pecl.php.net/        PECL Repository
 .fi
 .SH NOTES
-.PP
+.LP
+PHP 5.2 may be removed in a future update.
+Newer versions of PHP will appear in a future Solaris.
+.LP
+Please migrate to a newer version.
+Migration documentation is available on the PHP website:
+.LP
+.nf
+http://php.net/manual/en/appendices.php
+.fi
+.LP
+If it is desired to keep the obsolete version of PHP
+then it should be frozen to prevent its removal by a future update.
+.LP
+.nf
+pkg freeze 'web/php-52*' web/server/apache-22/module/apache-php52
+pkg change-facet --no-backup-be 'version-lock\&.web/php-52*=False' \e
+    version-lock\&.web/server/apache-22/module/apache-php52=False
+.fi
+.LP
+Please note that the freezing of packages may yield
+an unsupportable system so use with caution.
+.LP
 PHP has been built to be largefile-aware and to use
 64-bit integers, although the interpreter and the library
 themselves are 32-bit applications (LP32).
-.PP
+.LP
 If you wish to build and install PHP add-on modules from PECL,
 you can do so using the phpize script  -  see phpize(1) for
 details.
-.PP
-Solaris ships with PHP 5.2.17 and 5.3.14.
-To install PHP 5.2.17 use the pkg(1) command:
-.PP
+.LP
+Solaris ships with PHP 5.2 and 5.3.
+To install PHP 5.2 use the pkg(1) command:
+.LP
+.nf
 pkg install web/php-52 web/server/apache-22/module/apache-php52
-.PP
-To install PHP 5.3.14:
-.PP
+.fi
+.LP
+To install PHP 5.3:
+.LP
+.nf
 pkg install web/php-53 web/server/apache-22/module/apache-php53
-.PP
+.fi
+.LP
 Documentation is separate:
-.PP
+.LP
+.nf
 pkg install web/php-53/documentation
-.PP
+.fi
+.LP
 Before and after installing check or set the value of PHP's pkg
 mediator to the default version desired:
-.PP
+.LP
+.nf
 pkg mediator
-.PP
+.fi
+.LP
 To set the default version of PHP change the pkg mediator value:
-.PP
+.LP
+.nf
 pkg set-mediator -V 5.3 php
-.PP
+.fi
+.LP
 where php mediator values are 5.2 or 5.3.
-.PP
+.LP
 The configuration of php is controlled by editing the php
 configuration file for that specific version:
-.PP
+.LP
+.nf
 /etc/apache2/2.2/conf.d/php/php5.2.conf
 .br
 or
 .br
 /etc/apache2/2.2/conf.d/php/php5.3.conf
-.PP
+.fi
+.LP
 The pkg mediator will select the proper file to use.
-.PP
+.LP
 PHP is a recursive acronym which stands for PHP Hypertext Pages.