fix: align fallback checks with serialized tag names - #44
Open
Adyej999 wants to merge 1 commit into
Open
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Adyej999
force-pushed
the
fix/serialized-fallback-ancestor-identity
branch
from
September 7, 2026 20:20
519e9a0 to
b8eded4
Compare
Adyej999
force-pushed
the
fix/serialized-fallback-ancestor-identity
branch
from
September 7, 2026 20:26
b8eded4 to
82ac580
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.
PR Checklist
PR Type
What is the current behavior?
Domino uses different element identities when determining whether an ancestor is a fallback raw-content element and when serializing that same element.
fallbackRawContentTags()currently only recognizes fallback ancestors in the HTML namespace:However,
serializeOne()serializes HTML, SVG, and MathML elements usinglocalName:This means an element can be omitted from the fallback raw-content ancestor check while still being emitted with a fallback raw-content tag name such as
noembedoriframe.For example:
is serialized as:
but was not previously recognized as a
noembedancestor byfallbackRawContentTags().This affects the existing
ProcessingInstructionclosing-tag protection.Given:
followed by a sibling:
the unpatched serializer can produce:
When the serialized SSR output is parsed as HTML, the matching
</noembedsequence terminates the fallback raw-content context and the following sibling is parsed as active HTML.What is the new behavior?
Element-name selection is centralized in a shared helper:
serializeOne()uses the same helper when determining the emitted element name:and
fallbackRawContentTags()uses that identity for fallback ancestor detection:As a result, an ancestor that serializes with a fallback raw-content tag name is also recognized by the existing closing-tag protection.
For the same SVG
noembedexample, serialization becomes:The matching closing-tag prefix is escaped and therefore does not terminate the fallback raw-content context.
Security impact
This keeps fallback raw-content ancestor detection consistent with the element identity used in serialized HTML.
Without this consistency, namespace or qualified-name representations can bypass the existing
ProcessingInstructionancestor-closing-tag protection while still producing the corresponding fallback tag name in the serialized response.The demonstrated path is:
This behavior was reproduced directly in Chromium against the Angular-pinned Domino revision.
Relation to GHSA-j3r3-mxqp-r2p4
GHSA-j3r3-mxqp-r2p4 introduced escaping for matching fallback raw-content ancestor closing tags in
ProcessingInstructiondata.That protection depends on
fallbackRawContentTags()correctly identifying the relevant serialized ancestor.This change does not alter the
ProcessingInstructionescaping mechanism itself. Instead, it makes the ancestor identity used by that protection consistent with the identity used by element serialization.The existing escaping mechanism is therefore reused once the serialized fallback ancestor is identified correctly.
Does this PR introduce a breaking change?
For normal element serialization, this only centralizes the existing tag-name selection into a shared helper and does not change which tag name is emitted.
The intentional behavior change is limited to recognizing additional serialized fallback ancestors in the existing security-sensitive escaping paths.
Tests
A regression test was added for:
noembed;noembed;iframe;iframe.The regression uses the executable sibling shape:
The regression was first verified against the unmodified Angular-pinned Domino revision:
Before this change, the regression fails because the matching fallback closing-tag prefix is not escaped.
With this change applied:
The following checks were run locally:
Other information
The browser portion was also validated directly in Chromium against the exact unmodified Angular-pinned Domino revision:
Before this change, all tested representations resulted in JavaScript execution:
For example, the unpatched SVG
noembedcase serialized as:and Chromium displayed the expected dialog.
With this PR applied, the same case serializes with the matching closing-tag prefix escaped:
and Chromium does not execute the sibling handler.
The same before/after behavior was verified for all four regression representations.