change PasswordFnSink to RandomFnSink

This commit is contained in:
liangjinhuang
2021-12-11 12:31:20 +08:00
parent 1102f60f3e
commit 77b5f422ba

View File

@@ -55,14 +55,14 @@ module InsecureRandomness {
}
/**
* A use in a function that heuristically deals with passwords.
* A use in a function that heuristically deals with unsafe random numbers or random strings.
*/
class PasswordFnSink extends Sink {
PasswordFnSink() {
exists(DataFlowCallable passwordFn |
passwordFn.getName().regexpMatch("(?i).*(gen(erate)?|salt|make|mk)Password.*")
class RandomFnSink extends Sink {
RandomFnSink() {
exists(DataFlowCallable randomFn |
randomFn.getName().regexpMatch("(?i).*(gen(erate)?|salt|make|mk).*")
|
this.getEnclosingCallable() = passwordFn
this.getEnclosingCallable() = randomFn
)
}
}