Commit 2673880af5d for php
commit 2673880af5d6b7323a76a7b0fd883ccbc63b1468
Merge: fb3a4a211d8 a8c581a9439
Author: Daniel Scherzer <daniel.e.scherzer@gmail.com>
Date: Sat Dec 5 13:07:11 2026 -0800
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
Fix GH-24729: UAF in ReflectionClass::setStaticPropertyValue() (#24732)
diff --cc NEWS
index 38b818a4e59,e1c79d2067a..0bc2a62a1da
--- a/NEWS
+++ b/NEWS
@@@ -25,11 -23,15 +25,16 @@@ PH
- Opcache:
. Fixed type inference of JIT trace after FE_FETCH_R[W] with identical
branches. (ilutov, Arnaud)
- . Fixed bug GH-26048 (Tracing JIT: segfault when a hooked property is passed
- as an argument to a run-time-resolved call (FETCH_OBJ_FUNC_ARG) in a hot
- loop). (David Carlier)
+ - Reflection:
+ . Fixed bug GH-24729 (Use-after-free in
+ ReflectionClass::setStaticPropertyValue() when the old value's destructor
+ unbinds the property). (Lazizbek Ergashev)
+
+- Session:
+ . Fixed new empty sessions never being stored with lazy_write and strict
+ mode. (Jorg Sowa)
+
- Standard:
. Fixed bug GH-25959 ("consumed" stream filter loses or repeats data).
(Artem Ukrainskiy)
diff --cc ext/reflection/php_reflection.c
index 618be5a40f6,d9d7f1da156..e8669636ced
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -4229,16 -4393,7 +4229,7 @@@ ZEND_METHOD(ReflectionClass, setStaticP
RETURN_THROWS();
}
- if (Z_ISREF_P(variable_ptr)) {
- zend_reference *ref = Z_REF_P(variable_ptr);
- variable_ptr = Z_REFVAL_P(variable_ptr);
-
- if (!zend_verify_ref_assignable_zval(ref, value, false)) {
- return;
- }
- }
-
- if (ZEND_TYPE_IS_SET(prop_info->type) && !zend_verify_property_type(prop_info, value, 0)) {
+ if (ZEND_TYPE_IS_SET(prop_info->type) && !zend_verify_property_type(prop_info, value, false)) {
return;
}