diff options
author | Florian Smeets <flo@FreeBSD.org> | 2015-02-24 22:36:49 +0000 |
---|---|---|
committer | Florian Smeets <flo@FreeBSD.org> | 2015-02-24 22:36:49 +0000 |
commit | a3487b0b0959f97b6226d927aec54ac1599a950b (patch) | |
tree | 9610e048866efffff97a4a5be14c3200b7207c75 | |
parent | 990bb0fdf6b9279aaa4bb56ba26f5c37228e740b (diff) |
Add patches for
- CVE-2014-8142
- CVE-2015-0231
MFH: 2015Q1
Notes
Notes:
svn path=/head/; revision=379853
-rw-r--r-- | lang/php53/Makefile | 2 | ||||
-rw-r--r-- | lang/php53/files/patch-CVE-2014-8142.patch | 56 | ||||
-rw-r--r-- | lang/php53/files/patch-CVE-2015-0231.patch | 56 |
3 files changed, 113 insertions, 1 deletions
diff --git a/lang/php53/Makefile b/lang/php53/Makefile index fbd8eba13675..deb574bff9c1 100644 --- a/lang/php53/Makefile +++ b/lang/php53/Makefile @@ -3,7 +3,7 @@ PORTNAME= php53 PORTVERSION= 5.3.29 -PORTREVISION?= 3 +PORTREVISION?= 4 CATEGORIES?= lang devel www MASTER_SITES= ${MASTER_SITE_PHP} MASTER_SITE_SUBDIR= distributions diff --git a/lang/php53/files/patch-CVE-2014-8142.patch b/lang/php53/files/patch-CVE-2014-8142.patch new file mode 100644 index 000000000000..f023909d9024 --- /dev/null +++ b/lang/php53/files/patch-CVE-2014-8142.patch @@ -0,0 +1,56 @@ +Index: ext/standard/tests/serialize/bug68594.phpt +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ext/standard/tests/serialize/bug68594.phpt 2015-02-13 11:27:34.753347966 -0500 +@@ -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=== +Index: ext/standard/var_unserializer.c +=================================================================== +--- ext/standard/var_unserializer.c 2015-02-13 11:27:34.793348294 -0500 ++++ ext/standard/var_unserializer.c 2015-02-13 11:27:34.753347966 -0500 +@@ -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); + } +Index: ext/standard/var_unserializer.re +=================================================================== +--- ext/standard/var_unserializer.re 2015-02-13 11:27:34.793348294 -0500 ++++ ext/standard/var_unserializer.re 2015-02-13 11:27:34.753347966 -0500 +@@ -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); + } diff --git a/lang/php53/files/patch-CVE-2015-0231.patch b/lang/php53/files/patch-CVE-2015-0231.patch new file mode 100644 index 000000000000..535e59013104 --- /dev/null +++ b/lang/php53/files/patch-CVE-2015-0231.patch @@ -0,0 +1,56 @@ +Index: ext/standard/tests/strings/bug68710.phpt +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ext/standard/tests/strings/bug68710.phpt 2015-02-13 11:36:32.969760122 -0500 +@@ -0,0 +1,25 @@ ++--TEST-- ++Bug #68710 Use after free vulnerability in unserialize() (bypassing the ++CVE-2014-8142 fix) ++--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("aaa", "123", $z); ++ $z = str_replace("bbb", "123", $z); ++ $y = unserialize($z); ++ $z = serialize($y); ++} ++?> ++===DONE=== ++--EXPECTF-- ++===DONE=== +Index: ext/standard/var_unserializer.c +=================================================================== +--- ext/standard/var_unserializer.c 2015-02-13 11:36:33.009760449 -0500 ++++ ext/standard/var_unserializer.c 2015-02-13 11:36:32.969760122 -0500 +@@ -298,7 +298,7 @@ + } 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) { ++ if (zend_hash_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, +Index: ext/standard/var_unserializer.re +=================================================================== +--- ext/standard/var_unserializer.re 2015-02-13 11:36:33.009760449 -0500 ++++ ext/standard/var_unserializer.re 2015-02-13 11:36:32.969760122 -0500 +@@ -304,7 +304,7 @@ + } 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) { ++ if (zend_hash_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, |