You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ext/dom: UAF node_list_unlink() skips attribute children that still have a live wrapper #23331
node_list_unlink() is meant to detach an attribute's children that still have a live PHP wrapper before libxml2 frees them, but it has two exits that abandon the remaining siblings:
xmlUnlinkNode(node) zeroes node->next, so the loop advance node = node->next reads NULL and stops;
the break on XML_ENTITY_REF_NODE leaves the loop entirely rather than just skipping recursion into the entity reference.
Any child past either exit is then freed by xmlSetProp() / xmlSetNsProp() / xmlFreeProp() while its PHP wrapper stays alive, so the wrapper reads freed memory.
Activity
Fix phpGH-23331: UAF when an attribute child keeps a live wrapper
Fix phpGH-23331: UAF when an attribute child keeps a live wrapper
Merge branch 'PHP-8.5'
Fix phpGH-23331: UAF when an attribute child keeps a live wrapper
Merge branch 'PHP-8.4' into PHP-8.5