Skip to content

Commit 8fb75f4

Browse files
committed
Consider MaD models ref whether a package should be considered an unknown external.
1 parent 9447dfd commit 8fb75f4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

go/ql/lib/semmle/go/security/ExternalAPIs.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*/
55

66
import go
7+
8+
private import semmle.go.dataflow.FlowSummary
79
private import Xss
810
private import SqlInjectionCustomizations
911
private import RequestForgeryCustomizations
@@ -148,10 +150,17 @@ Package getAPackageWithFunctionModels() {
148150
exists(getAMethodModelInPackage(result))
149151
}
150152

153+
/** Gets the name of a package that has at least one SummarizedCallable. */
154+
Package getAPackageWithSummarizedCallables() {
155+
result = any(SummarizedCallable c).asFunction().getPackage()
156+
}
157+
151158
/** Gets the name of a package which has models. */
152159
Package getAPackageWithModels() {
153160
result = getAPackageWithFunctionModels()
154161
or
162+
result = getAPackageWithSummarizedCallables()
163+
or
155164
// An incomplete list of packages which have been modeled but do not have any function models
156165
result.getPath() in [
157166
Logrus::packagePath(), GolangOrgXNetWebsocket::packagePath(), GorillaWebsocket::packagePath()

0 commit comments

Comments
 (0)