Skip to content

ext/dom: Use-after-free with namespace nodes from XSLTProcessor::regi…#22623

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

ext/dom: Use-after-free with namespace nodes from XSLTProcessor::regi…#22623
devnexen wants to merge 1 commit into
php:masterfrom
devnexen:gh22621

Conversation

@devnexen

@devnexen devnexen commented Jul 6, 2026

Copy link
Copy Markdown
Member

…sterPHPFunctions().

Fix #22621

Namespace parents from an external document() were wrapped directly instead of through the proxy factory, so they skipped the copy that keeps non-main-document nodes alive. A DOMNameSpaceNode retained by userland then dangled once xsltFreeTransformContext() freed the external document. Route the namespace parent through the proxy factory too.

…sterPHPFunctions().

Fix php#22621

Namespace parents from an external document() were wrapped directly
instead of through the proxy factory, so they skipped the copy that
keeps non-main-document nodes alive. A DOMNameSpaceNode retained by
userland then dangled once xsltFreeTransformContext() freed the external
document. Route the namespace parent through the proxy factory too.
@devnexen devnexen marked this pull request as ready for review July 7, 2026 12:16

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do we need a NEWS for this?
  • Should this be rebased on 8.4?

@devnexen

devnexen commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

I rarely think of creating NEWS/UPGRADING entry in a PR usually I do at commit time. and I target master (same for the other PR) because see how it s labeled.

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.

UAF via XSLTProcessor::registerPHPFunctions()

2 participants