DOMPurify icon indicating copy to clipboard operation
DOMPurify copied to clipboard

Does DOMPurify support Jquery by default?

Open fmigliorato opened this issue 1 year ago • 3 comments

In a project we are using DOMPurify with jPurify. The problem is that it does not support the append() method. I read about a PR in the jPurify repository that adds append for jQuery version 3.1.1, while we are using 3.7.1.

I have also read that jPurify is no longer supported. Would using DOMPurify alone be enough to solve this? Is jQuery's append() method supported? Thank you very much.

fmigliorato avatar Jan 24 '25 09:01 fmigliorato

Hey there :) I would assume yes, that should still work.

If you hook into append() and the force the sanitization via DOMPurify, you should be doing the right thing to combat XSS. From what we know right now, our current sanitization automatically covers jQuery's HTML parsing weirdness and all should be good.

cure53 avatar Jan 24 '25 09:01 cure53

Thank You for the quick reply! <3

fmigliorato avatar Jan 24 '25 09:01 fmigliorato

You are welcome, let me know please how it went and if it worked :) Thx.

cure53 avatar Jan 24 '25 09:01 cure53