Skip to content

ext/spl: SplDoublyLinkedList::serialize() use-after-free on element r… - #23388

Open
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:gh23385
Open

ext/spl: SplDoublyLinkedList::serialize() use-after-free on element r…#23388
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:gh23385

Conversation

@devnexen

Copy link
Copy Markdown
Member

…emoval.

Fix #23385

The serialization loop passed php_var_serialize() a pointer into the list element itself, so a userland __serialize() unsetting that entry freed both the element and its payload while the serializer was still walking them. Serialize a copy of the element data instead, which outlives the callback.

…emoval.

Fix php#23385

The serialization loop passed php_var_serialize() a pointer into the list
element itself, so a userland __serialize() unsetting that entry freed both
the element and its payload while the serializer was still walking them.
Serialize a copy of the element data instead, which outlives the callback.
@LamentXU123

Copy link
Copy Markdown
Member

@devnexen There are already a PR #23387 :)

@devnexen

devnexen commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

I saw it but I assigned it to myself prior but also his fix is not correct (spl part at least).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use-after-free in SplDoublyLinkedList::serialize()

2 participants