Skip to content

Commit 1c9e319

Browse files
committed
JS: Added test case which is not flagged but should be abusing new RegExp with global flag
1 parent b39a8fe commit 1c9e319

File tree

1 file changed

+5
-1
lines changed
  • javascript/ql/test/query-tests/Security/CWE-116/IncompleteSanitization

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,8 @@ function incompleteComplexSanitizers() {
327327
if (str === "\"")
328328
return """;
329329
}) + '"';
330-
}
330+
}
331+
332+
function typicalBadHtmlSanitizers(s) {
333+
s().replace(new RegExp("[<>]", "g"),''); // NOT OK -- should be not okay, but is not flagged
334+
}

0 commit comments

Comments
 (0)