soap: reject self-referential schema group and attributeGroup fix-up - #23600
Open
iliaal wants to merge 1 commit into
Open
soap: reject self-referential schema group and attributeGroup fix-up#23600iliaal wants to merge 1 commit into
iliaal wants to merge 1 commit into
Conversation
iliaal
force-pushed
the
promote/soap-schema-selfref
branch
from
September 6, 2026 15:08
18c8e78 to
183f99d
Compare
iliaal
added a commit
to iliaal/php-src
that referenced
this pull request
Sep 6, 2026
schema_content_model_fixup() and schema_attributegroup_fixup() followed a group ref back into schema_type_fixup() with nothing tracking the types already being fixed up, so a schema whose group references itself recursed until the C stack ran out. Track the in-progress types in the sdl context and raise a parse error when one is re-entered. Closes phpGH-23600
NickSdot
reviewed
Sep 6, 2026
devnexen
approved these changes
Sep 6, 2026
| if (ctx->attributeGroups != NULL) { | ||
| tmp = (sdlTypePtr)schema_find_by_ref(ctx->attributeGroups, attr->ref); | ||
| if (tmp) { | ||
| if (zend_hash_index_find_ptr(&ctx->fixupInProgress, (zend_ulong)tmp) != NULL) { |
Member
There was a problem hiding this comment.
nit: when you merge up to master, should be
(zend_ulong)(uintptr_t)tmp
iliaal
added a commit
to iliaal/php-src
that referenced
this pull request
Sep 6, 2026
schema_content_model_fixup() and schema_attributegroup_fixup() followed a group ref back into schema_type_fixup() with nothing tracking the types already being fixed up, so a schema whose group references itself recursed until the C stack ran out. Track the in-progress types in the sdl context and raise a parse error when one is re-entered. Closes phpGH-23600
iliaal
force-pushed
the
promote/soap-schema-selfref
branch
from
September 6, 2026 20:59
183f99d to
a616627
Compare
schema_content_model_fixup() and schema_attributegroup_fixup() followed a group ref back into schema_type_fixup() with nothing tracking the types already being fixed up, so a schema whose group references itself recursed until the C stack ran out. Track the in-progress types in the sdl context and raise a parse error when one is re-entered. Closes phpGH-23600
iliaal
force-pushed
the
promote/soap-schema-selfref
branch
from
September 6, 2026 21:07
a616627 to
b8946c2
Compare
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.
schema_content_model_fixup()andschema_attributegroup_fixup()follow a grouprefback intoschema_type_fixup()with nothing tracking which types are already being fixed up, so a schema whose group or attributeGroup references itself recurses until the C stack is exhausted. The sdl context now tracks the in-progress types and raises a parse error when one is re-entered.Both tests segfault without the change.