Fix GH-23332: ArrayObject iterator saturation leads to UAF - #23399
Closed
luizmenos wants to merge 1 commit into
Closed
Fix GH-23332: ArrayObject iterator saturation leads to UAF#23399luizmenos wants to merge 1 commit into
luizmenos wants to merge 1 commit into
Conversation
Contributor
|
The fix looks correct, I came up with the same one (iliaal#243) One bit of feedback is the issue is not SPL specific, so the test can be inside Zend/ and not depend on SPL Also, this should be based on 8.4 branch not just master |
luizmenos
requested review from
SakiTakamachi,
TimWolla,
arnaud-lb and
kocsismate
as code owners
August 21, 2026 13:26
luizmenos
force-pushed
the
fix/gh-23332
branch
from
August 21, 2026 13:30
1730c4d to
94b9a09
Compare
luizmenos
force-pushed
the
fix/gh-23332
branch
from
August 21, 2026 13:33
94b9a09 to
fee505f
Compare
Author
|
@iliaal thanks for your feedback! Since your PR iliaal#243 provides a more comprehensive fix i'll just close this one :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #23332
Before decrementing the iterator count,
zend_hash_iterator_pos_ex()checked the overflow state of the wrong hash table. The check used the new hash table (ht), while the count was decremented on the iterator's current hash table (iter->ht).When the current hash table's iterator count was saturated, this could make the count inconsistent and eventually lead to a use-after-free.