Skip to content

Commit 9978cec

Browse files
committed
docs: Added better security warning about SAFE_FOR_XML to README
1 parent fa542df commit 9978cec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ const clean = DOMPurify.sanitize(dirty, {SAFE_FOR_TEMPLATES: true});
181181

182182

183183
// change how e.g. comments containing risky HTML characters are treated.
184+
// be very careful, this setting should only be set to `false` if you really only handle
185+
// HTML and nothing else, no SVG, MathML or the like.
186+
// Otherwise, changing from `true` to `false` will lead to XSS in this or some other way.
184187
const clean = DOMPurify.sanitize(dirty, {SAFE_FOR_XML: false});
185188
```
186189

0 commit comments

Comments
 (0)