Endless loop of DOMParser.parseFromString
when used with Trusted Types polyfill
#563
Labels
DOMParser.parseFromString
when used with Trusted Types polyfill
#563
This same issue has been raised at cure53/DOMPurify#1027, but they believe it's not a DOMPurify issue but rather an issue with the polyfill.
Background & Context
When trying to use DOMPurify in conjunction with the trustedTypes polyfill, the HTML is not sanitized but rather seems to run into an endless loop as if DOMPurify does not set its "dompurify" policy. Not sure if it's a DOMPurify issue, or an issue with the polyfill, or if I'm using it wrong, sorry if this is the wrong place to ask.
Input
This is the sample JavaScript code which then I bundle with webpack.
Given output
Example output from Safari, caught in an endless loop of thousands of
DOMParser.parseFromString
sanitization instances. At some point it ends but I believe the browser is doing it. If I try it in Chrome, it never ends and hangs the tab.Expected output
Expected a TrustedHTML object.
The text was updated successfully, but these errors were encountered: