Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sanitization of attributes that require Trusted Types #699

Merged
merged 1 commit into from Jul 18, 2022

Conversation

tosmolka
Copy link
Contributor

Summary

This PR should fix 660 for attributes without namespace.

Background & Context

We want to use DOMPurify to allow script.src attribute and provide custom src validation via hooks. This is not possible today as DOMPurify will call setAttribute with raw string and cause Trusted Types Sink violation.

This PR leverages TrustedTypePolicyFactory.getAttributeType() to handle such cases.

@cure53
Copy link
Owner

cure53 commented Jul 18, 2022

This looks great, thank you!

@cure53 cure53 merged commit 2fe2a34 into cure53:main Jul 18, 2022
@cure53
Copy link
Owner

cure53 commented Jul 18, 2022

Do you need a release for this?

@tosmolka
Copy link
Contributor Author

Yes please but we can wait a week or two if needed.

@cure53
Copy link
Owner

cure53 commented Jul 18, 2022

Which is exactly when I will be on vacation 😬 That is why I am asking 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOMPurify fails on sanitization of Trusted Types sink attributes
2 participants