Do not use getACall() when we only want direct calls

In both of these locations we do not want calls through interface methods.
This commit is contained in:
Owen Mansel-Chan
2022-01-18 23:36:14 +00:00
parent 1aebf4ccac
commit 3c02403701
2 changed files with 2 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ class ExternalAPIDataNode extends DataFlow::Node {
// Not already modeled as a taint step
not exists(DataFlow::Node next | TaintTracking::localTaintStep(this, next)) and
// Not a call to a known safe external API
not call = any(SafeExternalAPIFunction f).getACall()
not call.getTarget() instanceof SafeExternalAPIFunction
}
/** Gets the called API `Function`. */

View File

@@ -60,7 +60,7 @@ module InsecureRandomness {
// Some interfaces in the `crypto` package are the same as interfaces
// elsewhere, e.g. tls.listener is the same as net.Listener
not fn.hasQualifiedName(nonCryptoInterface(), _) and
this = fn.getACall().getAnArgument()
exists(DataFlow::CallNode call | call.getTarget() = fn and this = call.getAnArgument())
)
}