JS: Added test cases with new RegExp for Tainted paths, currently works only with literals

This commit is contained in:
Napalys
2024-11-26 12:27:11 +01:00
parent faef9dd877
commit 7db6f7c721
4 changed files with 326 additions and 3 deletions

View File

@@ -221,10 +221,10 @@ module TaintedPath {
this instanceof StringReplaceCall and
input = this.getReceiver() and
output = this and
not exists(RegExpLiteral literal, RegExpTerm term |
this.(StringReplaceCall).getRegExp().asExpr() = literal and
not exists(DataFlow::RegExpCreationNode regexp, RegExpTerm term |
this.(StringReplaceCall).getRegExp() = regexp and
this.(StringReplaceCall).isGlobal() and
literal.getRoot() = term
regexp.getRoot() = term
|
term.getAMatchedString() = "/" or
term.getAMatchedString() = "." or