Skip to content

Commit 3e3372b

Browse files
committed
recognize DOMPurify.sanitize as a HTML sanitizer
1 parent 3f66c04 commit 3e3372b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

javascript/ql/src/semmle/javascript/HtmlSanitizers.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ private class DefaultHtmlSanitizerCall extends HtmlSanitizerCall {
4848
or
4949
callee = LodashUnderscore::member("escape")
5050
or
51+
exists(DataFlow::PropRead read | read = callee |
52+
read.getPropertyName() = "sanitize" and
53+
read.getBase().asExpr().(VarAccess).getName() = "DOMPurify"
54+
)
55+
or
5156
exists(string name | name = "encode" or name = "encodeNonUTF" |
5257
callee =
5358
DataFlow::moduleMember("html-entities", _).getAnInstantiation().getAPropertyRead(name) or

0 commit comments

Comments
 (0)