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

Use Trusted Types in DOMPurify #5576

Open
sosnovsky opened this issue Jan 23, 2024 · 0 comments
Open

Use Trusted Types in DOMPurify #5576

sosnovsky opened this issue Jan 23, 2024 · 0 comments
Assignees
Milestone

Comments

@sosnovsky
Copy link
Collaborator

sosnovsky commented Jan 23, 2024

I think it is also a good idea to update some of the few options for the DOMPurify configuration option to return trusted type by adding the RETURN_TRUSTED_TYPE property set to true when DOMPurify.sanitize() is used:

export declare function sanitize(source: string | Node, config: Config & { RETURN_DOM: true; }): HTMLElement;

Reference:
https://github.com/cure53/DOMPurify?tab=readme-ov-file#what-about-dompurify-and-trusted-types
https://web.dev/articles/trusted-types#use_a_library

Originally posted by @martgil in #5575 (review)

@sosnovsky sosnovsky added this to the 8.5.4 milestone Jan 23, 2024
@martgil martgil self-assigned this Jan 24, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.4, 8.5.5 Mar 1, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.5, 8.5.6 May 13, 2024
@sosnovsky sosnovsky modified the milestones: 8.5.6, First priority May 23, 2024
@martgil martgil modified the milestones: First priority, later Oct 27, 2024
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 a pull request may close this issue.

2 participants