Skip to content

Reject embedded NUL in SimpleXMLElement path/URL constructor - #216

Closed
iliaal wants to merge 6 commits into
PHP-8.4from
fix/sxe-ctor-nul-path
Closed

Reject embedded NUL in SimpleXMLElement path/URL constructor#216
iliaal wants to merge 6 commits into
PHP-8.4from
fix/sxe-ctor-nul-path

Conversation

@iliaal

@iliaal iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner

When dataIsURL is true, SimpleXMLElement::__construct parsed the path as a plain string and passed it to xmlReadFile, so an embedded NUL truncated the path. simplexml_load_file already rejects NULs; match that check before xmlReadFile.

shivammathur and others added 5 commits August 5, 2026 12:27
* PHP-8.2:
  Fix hMailServer URL in Windows CI (php#23055)
* PHP-8.3:
  Fix hMailServer URL in Windows CI (php#23055)
The id must be reset to NULL before calling code that can invoke
userland code, as the id remains visible after release due to a stale
pointer.

Closes phpGH-23046.
@iliaal
iliaal force-pushed the fix/sxe-ctor-nul-path branch from 8bdabfd to 49c4d81 Compare August 5, 2026 13:27
When dataIsURL is true, __construct parsed the path as a plain string
and passed it to xmlReadFile, so an embedded NUL truncated the path.
simplexml_load_file already rejects NULs via the path parameter type.
Match that check before xmlReadFile.

Closes phpGH-23069
@iliaal
iliaal force-pushed the fix/sxe-ctor-nul-path branch from 49c4d81 to 3f8efc2 Compare August 5, 2026 13:28
@iliaal

iliaal commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Promoted upstream as php#23069.

@iliaal iliaal closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants