mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects This also moves tests into a subfolder.
22 lines
729 B
PHP
22 lines
729 B
PHP
--TEST--
|
|
SPL: Bug #70155 Use After Free Vulnerability in unserialize() with SPLArrayObject
|
|
--FILE--
|
|
<?php
|
|
$inner = 'x:i:0;O:12:"DateInterval":1:{s:1:"y";i:3;};m:a:1:{i:0;R:2;}';
|
|
$exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}';
|
|
$data = unserialize($exploit);
|
|
|
|
var_dump($data);
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: ArrayObject::unserialize(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d
|
|
|
|
Deprecated: Creation of dynamic property ArrayObject::$0 is deprecated in %s on line %d
|
|
|
|
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in %s
|
|
Stack trace:
|
|
%s
|
|
%s
|
|
%s
|
|
%s
|