Skip to content

Avoid creating indirect pointer in SplFixedArray __wakeup in 8.1+ #9706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: PHP-8.1
Choose a base branch
from

Conversation

TysonAndre
Copy link
Contributor

A typed property of an object properties table is an indirect pointer (IS_IND) to a typed reference (IS_REF).
With https://wiki.php.net/rfc/restrict_globals_usage, php 8.1 arrays are meant to stop containing IS_IND pointers,
and php-src removed code to check for IS_IND pointers.

unserialize() would also be affected.

A more aggressive bug fix would be to also stop allowing references in unserialize entirely, though there's a tiny chance application behavior would depend on these references, so that fix wasn't backported.

A typed property of an object properties table is an indirect pointer (IS_IND)
to a typed reference (IS_REF).
With https://wiki.php.net/rfc/restrict_globals_usage, php 8.1 arrays are
meant to stop containing IS_IND pointers,
and php-src removed code to check for IS_IND pointers.

`unserialize()` would also be affected.

A more aggressive bug fix would be to also stop allowing references in
unserialize entirely, though there's a tiny chance application behavior
would depend on these references, so that fix wasn't backported.
@TysonAndre
Copy link
Contributor Author

SplFixedArray __unserialize and __serialize were added in php 8.2, and also require fixes, but I discovered the bug #9707 which affects the test case I added when merging this change into php 8.2+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant