fix(compiler): strip namespaced SVG script elements during template compilation - #68689
Merged
Conversation
alan-agius4
marked this pull request as ready for review
May 12, 2026 11:38
alan-agius4
force-pushed
the
svg-script
branch
4 times, most recently
from
May 12, 2026 12:55
82cdc6c to
ff91288
Compare
josephperrott
approved these changes
May 12, 2026
josephperrott
left a comment
Member
There was a problem hiding this comment.
LGTM
Reviewed-for: fw-security
AndrewKushnir
approved these changes
May 12, 2026
alxhub
reviewed
May 12, 2026
| ]); | ||
| Object.entries(schema).forEach(([key, context]) => { | ||
| if (context === SecurityContext.URL || SecurityContext.RESOURCE_URL) { | ||
| if (context === SecurityContext.URL || context === SecurityContext.RESOURCE_URL) { |
alxhub
approved these changes
May 12, 2026
alxhub
left a comment
Member
There was a problem hiding this comment.
Reviewed-for: fw-general, fw-compiler, fw-security
dgp1130
approved these changes
May 12, 2026
Contributor
|
@alan-agius4 there are merge conflicts, please relabel once resolved. |
…ompilation Ensures that namespaced <script> elements (such as :svg:script) are correctly classified as PreparsedElementType.SCRIPT by the template preparser and stripped during compilation to prevent potential XSS vulnerabilities. Consequently, obsolete security schema mappings and runtime sanitization checks for <script> attributes have been removed since these elements are never present in compiled template outputs. Also corrects a truthiness evaluation bug in the runtime sanitization unit tests. Closes angular#68642
…plate compilation
Contributor
pull Bot
pushed a commit
to soloinovator/angular
that referenced
this pull request
May 20, 2026
angular#68689 recently updated the compiler schema which should be kept in sync with the core schema. Fix applied by running `pnpm bazel run //packages/core:dom_security_schema`.
leonsenft
added a commit
that referenced
this pull request
May 20, 2026
#68689 recently updated the compiler schema which should be kept in sync with the core schema. Fix applied by running `pnpm bazel run //packages/core:dom_security_schema`.
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Ensures that namespaced <script> elements (such as :svg:script) are correctly classified as PreparsedElementType.SCRIPT by the template preparser and stripped during compilation to prevent potential XSS vulnerabilities. Consequently, obsolete security schema mappings and runtime sanitization checks for <script> attributes have been removed since these elements are never present in compiled template outputs.
Also corrects a truthiness evaluation bug in the runtime sanitization unit tests.
Closes #68642