Skip to content

fix(core): add 'object' to SRC_RESOURCE_TAGS for stricter URL sanitization#67780

Closed
ZeroXJacks wants to merge 1 commit intoangular:mainfrom
ZeroXJacks:main
Closed

fix(core): add 'object' to SRC_RESOURCE_TAGS for stricter URL sanitization#67780
ZeroXJacks wants to merge 1 commit intoangular:mainfrom
ZeroXJacks:main

Conversation

@ZeroXJacks
Copy link
Copy Markdown

Problem

The <object data="..."> element can load external executable resources
similar to <iframe src="/deoxy?target=https%3A%2F%2Fredirect.github.com%2Fangular%2Fangular%2Fpull%2F..."> and <embed src="/deoxy?target=https%3A%2F%2Fredirect.github.com%2Fangular%2Fangular%2Fpull%2F...">, but it was missing
from SRC_RESOURCE_TAGS in sanitization.ts.

This caused getUrlSanitizer() to use the weaker ɵɵsanitizeUrl instead
of the stricter ɵɵsanitizeResourceUrl for <object> elements.

Fix

Added 'object' to SRC_RESOURCE_TAGS so that bindings like
<object [attr.data]="url"> are treated as resource URLs and
sanitized accordingly.

Related

  • Similar to how embed, iframe, and script are handled

Added 'object' tag to SRC_RESOURCE_TAGS for improved sanitization.
@google-cla

This comment was marked as outdated.

@leonsenft leonsenft added the area: core Issues related to the framework runtime label Mar 21, 2026
@ngbot ngbot bot added this to the Backlog milestone Mar 21, 2026
Copy link
Copy Markdown
Contributor

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

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

This change isn't quite right. As object does doesn't have a src attribute. I am doing some additional security hardning in #67797 and I'll handle this case too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants