Skip to content

Commit 60e6ac2

Browse files
committed
JS: Added test case for bad sanitizer with unknown flags, currently not flagged.
1 parent 4cfe63f commit 60e6ac2

File tree

1 file changed

+4
-0
lines changed
  • javascript/ql/test/query-tests/Security/CWE-116/IncompleteSanitization

1 file changed

+4
-0
lines changed

javascript/ql/test/query-tests/Security/CWE-116/IncompleteSanitization/tst.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,7 @@ function incompleteComplexSanitizers() {
332332
function typicalBadHtmlSanitizers(s) {
333333
s().replace(new RegExp("[<>]", "g"),''); // NOT OK
334334
}
335+
336+
function typicalBadHtmlSanitizers(s) {
337+
s().replace(new RegExp("[<>]", unknown()),''); // NOT OK -- should be flagged, because it is st ill a bad sanitizer
338+
}

0 commit comments

Comments
 (0)