Skip to content

[pull] master from php:master - #1199

Merged
pull[bot] merged 21 commits into
turkdevops:masterfrom
php:master
Aug 18, 2026
Merged

[pull] master from php:master#1199
pull[bot] merged 21 commits into
turkdevops:masterfrom
php:master

Conversation

@pull

@pull pull Bot commented Aug 18, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

iliaal and others added 21 commits August 18, 2026 22:38
getSingletonPos() read str[i+2] after the last '-' or '_' in a locale,
one byte past the NUL for strings such as "en-". Require i+2 to be inside
the string before testing it for another separator.

Output otherwise matches the unfixed parser unless that heap byte happens to
be another separator, which is why GH-22498 was previously closed.

Also audit getStrrtokenPos() and both callers, get_icu_value_internal() and
get_private_subtags(); their bounds handling is already safe.

Co-authored-by: Xuyang Zhang <119476662+kn1g78@users.noreply.github.com>
Closes #23350
* PHP-8.4:
  Bound getSingletonPos before reading the next separator (#23350)
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
When the last grapheme_str_split() group is short, ubrk_next() returns
UBRK_DONE and the loop still advanced pstr by -1 - current. Skip that
update when the iterator is done, matching the grapheme_strrev() fix.

Other ubrk_next() loops in grapheme_string.c and grapheme_util.c were
audited and already guard UBRK_DONE before using the position as an
offset.

Closes #23349
* PHP-8.4:
  Stop grapheme_str_split from using UBRK_DONE as a byte index (#23349)
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
So SNMP tests can work on other platforms, except Windows.
* PHP-8.4:
  ext/snmp: Put XFAILs under SKIPIF section in tests (#23237)
* PHP-8.5:
  Merge branch 'PHP-8.4' into PHP-8.5
node_list_unlink() detaches attribute children that still have a PHP
wrapper so libxml2 does not free them underneath it, but two exits
abandoned the rest of the list: xmlUnlinkNode() clears node->next, and
the XML_ENTITY_REF_NODE case broke out of the loop instead of only
skipping the borrowed entity children. Anything past either exit was
freed by xmlSetProp(), xmlSetNsProp() or xmlFreeProp() with a live
wrapper still pointing at it.

Fixes GH-23331
Closes GH-23337
* PHP-8.4:
  Fix GH-23331: UAF when an attribute child keeps a live wrapper
* PHP-8.5:
  Fix GH-23331: UAF when an attribute child keeps a live wrapper
dom_set_attribute_ns_modern() handed the element straight to
xmlSetNsProp(), which frees the existing attribute's child list, so a
live Dom\Text wrapper for one of those children was left pointing at
freed memory. Unlink the wrapped children first, as
dom_set_attribute_ns_legacy() already does.

Closes GH-23348
* PHP-8.4:
  Fix UAF when setAttributeNS() frees a wrapped attribute child
* PHP-8.5:
  Fix UAF when setAttributeNS() frees a wrapped attribute child
@pull pull Bot locked and limited conversation to collaborators Aug 18, 2026
@pull pull Bot added the ⤵️ pull label Aug 18, 2026
@pull
pull Bot merged commit 9f1437e into turkdevops:master Aug 18, 2026
0 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants