Unsecure use of DOMPurify detected.
- Rule ID: javascript_third_parties_dom_purify
- Languages: javascript
- Source: dom_purify.yml
Description
There are XSS vulnerabilites when using DOMPurify's sanitize without proper configuration
Remediations
Specify a secure configuration option:
DOMPurify.sanitize(htmlToSanitize, { RETURN_DOM_IMPORT:true })
or:
DOMPurify.sanitize(htmlToSanitize, { RETURN_DOM_FRAGMENT: true })
Resources
Associated CWE
OWASP Top 10
Ready to take the next step? Join the Bearer Cloud waitlist.