Skip to content

Commit 89a4c17

Browse files
committed
Remove the "o" serialization format
We never generate the "o" format during serialization, so let's not keep this unnecessary attack surface around.
1 parent 0daebf9 commit 89a4c17

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ PHP 7.4 UPGRADE NOTES
7575
passed. Previously this would generate a recoverable fatal error on the
7676
next extraction operation.
7777

78+
- Standard:
79+
. The "o" serialization format has been removed. As it is never produced by
80+
PHP, this may only break unserialization of manually crafted strings.
81+
7882
========================================
7983
2. New Features
8084
========================================

ext/standard/var_unserializer.re

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -948,17 +948,6 @@ use_double:
948948
return finish_nested_data(UNSERIALIZE_PASSTHRU);
949949
}
950950
951-
"o:" uiv ":" ["] {
952-
zend_long elements;
953-
if (!var_hash) return 0;
954-
955-
elements = object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR);
956-
if (elements < 0 || elements >= HT_MAX_SIZE) {
957-
return 0;
958-
}
959-
return object_common2(UNSERIALIZE_PASSTHRU, elements);
960-
}
961-
962951
object ":" uiv ":" ["] {
963952
size_t len, len2, len3, maxlen;
964953
zend_long elements;

0 commit comments

Comments
 (0)