prevent forged i18n marker injection & refresh namespace for i18n placeholders - #70363
Open
SkyZeroZx wants to merge 2 commits into
Open
prevent forged i18n marker injection & refresh namespace for i18n placeholders#70363SkyZeroZx wants to merge 2 commits into
SkyZeroZx wants to merge 2 commits into
Conversation
Treat translated text as untrusted instead of allowing it to become compiler-generated i18n structure. Without validation, forged structural and binding markers can target declaration slots or expressions outside the source message and leave runtime metadata inconsistent with the DOM. Reject reserved delimiters at the translation boundary and validate placeholder structure, node slots, and binding ranges before applying i18n opcodes. Preserve legitimate placeholder reordering, interpolations, and structural directive cases.
SkyZeroZx
force-pushed
the
fix/i18n-marked
branch
from
August 24, 2026 04:44
c3ecb85 to
e80aa47
Compare
i18n predeclares TNode placeholders before element instructions select their final namespace. Promoting an SVG placeholder without refreshing this field leaves HTML metadata attached to an SVG DOM element, so SVG-specific binding validation can use the wrong security context. Refresh the namespace from the current instruction state when adopting a placeholder and cover security-sensitive SMIL href animation bindings with an acceptance regression.
SkyZeroZx
force-pushed
the
fix/i18n-marked
branch
from
August 24, 2026 04:48
e80aa47 to
d8f99cd
Compare
SkyZeroZx
marked this pull request as ready for review
August 24, 2026 05:09
alan-agius4
requested review from
alxhub
and removed request for
alan-agius4 and
kirjs
August 25, 2026 12:17
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.
fix(core): prevent forged i18n marker injection
Treat translated text as untrusted instead of allowing it to become compiler-generated i18n structure. Without validation, forged structural and binding markers can target declaration slots or expressions outside the source message and leave runtime metadata inconsistent with the DOM.
Reject reserved delimiters at the translation boundary and validate placeholder structure, node slots, and binding ranges before applying i18n opcodes. Preserve legitimate placeholder reordering, interpolations, and structural directive cases.
fix(core): refresh namespace for i18n placeholders
i18n predeclares TNode placeholders before element instructions select their final namespace. Promoting an SVG placeholder without refreshing this field leaves HTML metadata attached to an SVG DOM element, so SVG-specific binding validation can use the wrong security context.
Refresh the namespace from the current instruction state when adopting a placeholder and cover security-sensitive SMIL href animation bindings.
More context https://issuetracker.google.com/u/1/issues/550667019
What is the new behavior?
Translated literals can no longer contain Angular's reserved
U+FFFDruntime marker.The translation is rejected before rendering. Runtime validation also throws
NG0700if a structural marker targets an occupied declaration slot, preventingTNodecorruption and theiframe[srcdoc]sanitization bypass.Nowlements created from i18n placeholders now receive the namespace selected by their element instruction.
Angular recognizes
<set>as an SVG element, throwsNG0910, and does not write the unsafetoattribute.