[php-src] PR #22401: Fix use-after-free during lazy object initialization
| From: | iliaal | Date: | Mon, 22 Jun 2026 16:57:44 +0000 |
| Subject: | [php-src] PR #22401: Fix use-after-free during lazy object initialization | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36555@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22401
Author: iliaal
Lazy object initialization destroyed property values while the slot or the dynamic-properties
HashTable still aliased them, so a value whose __destruct reaches back
through a reference cycle (unset($this->obj->prop)) double-freed it, a UAF in
zend_objects_store_del. The fix clears the slot and detaches the properties table
before dropping the refcount, across all four destruction sites in
zend_lazy_object_revert_init and zend_lazy_object_init_proxy (declared and
dynamic properties, ghost revert and proxy cleanup); verified under ASAN.
Fixes GH-22399