Skip to content

fix(core): sanitize sensitive attributes on SVG script elements#66318

Merged
kirjs merged 2 commits intoangular:mainfrom
alan-agius4:svg-script-security
Jan 6, 2026
Merged

fix(core): sanitize sensitive attributes on SVG script elements#66318
kirjs merged 2 commits intoangular:mainfrom
alan-agius4:svg-script-security

Conversation

@alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Jan 5, 2026

This commit updates the DOM security schema and sanitization logic to properly recognize and sanitize href and xlink:href attributes on SVG <script> elements.

Previously, these attributes were not treated as resource URLs, which could allow for Cross-Site Scripting (XSS) if attacker-controlled values were interpolated into them.

Context: http://b/472263766

@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Jan 5, 2026
@ngbot ngbot bot added this to the Backlog milestone Jan 5, 2026
@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release target: minor This PR is targeted for the next minor release requires: TGP This PR requires a passing TGP before merging is allowed action: presubmit The PR is in need of a google3 presubmit and removed target: patch This PR is targeted for the next patch release requires: TGP This PR requires a passing TGP before merging is allowed labels Jan 5, 2026
@alan-agius4
Copy link
Contributor Author

alan-agius4 commented Jan 5, 2026

TGP
TGP Deflake

@alan-agius4 alan-agius4 marked this pull request as ready for review January 5, 2026 13:30
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 5, 2026
@alan-agius4 alan-agius4 removed the action: presubmit The PR is in need of a google3 presubmit label Jan 5, 2026
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

@pullapprove pullapprove bot requested a review from jelbourn January 5, 2026 18:05
This commit updates the DOM security schema and sanitization logic to properly recognize and sanitize `href` and `xlink:href` attributes on SVG `<script>` elements.

Previously, these attributes were not treated as resource URLs, which could allow for Cross-Site Scripting (XSS) if attacker-controlled values were interpolated into them.
Copy link
Contributor

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-security

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 6, 2026
@kirjs kirjs merged commit 91dc91b into angular:main Jan 6, 2026
20 checks passed
This was referenced Jan 10, 2026
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants