mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Update RegExp handling and add test case
Co-authored-by: erik-krogh <erik-krogh@github.com>
This commit is contained in:
@@ -40,7 +40,7 @@ module CleartextLogging {
|
||||
exists(this.getRawReplacement().getStringValue()) and
|
||||
exists(DataFlow::RegExpCreationNode regexpObj |
|
||||
this.(StringReplaceCall).getRegExp() = regexpObj and
|
||||
regexpObj.getRoot() = any(RegExpDot term)
|
||||
regexpObj.getRoot() = any(RegExpDot term).getRootTerm()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,4 +181,5 @@ const debug = require('debug')('test');
|
||||
console.log(password.replace(new RegExp(".", "g"), "*")); // OK
|
||||
console.log(password.replace(new RegExp("."), "*")); // NOT OK
|
||||
console.log(password.replace(new RegExp(".", unknownFlags()), "*")); // OK -- Most likely not a problem.
|
||||
console.log(password.replace(new RegExp("pre_._suf", "g"), "*")); // OK
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user