diff --git a/ql/src/semmle/go/frameworks/NoSQL.qll b/ql/src/semmle/go/frameworks/NoSQL.qll index 46c73d6ad40..d80fe3f20b7 100644 --- a/ql/src/semmle/go/frameworks/NoSQL.qll +++ b/ql/src/semmle/go/frameworks/NoSQL.qll @@ -18,11 +18,6 @@ module NoSQL { NoSQLQueryString() { this = self } } - //TODO : Replace the following two predicate definitions with a simple call to package() - private string mongoDb() { result = "go.mongodb.org/mongo-driver/mongo" } - - private string mongoBsonPrimitive() { result = "go.mongodb.org/mongo-driver/bson/primitive" } - /** Provides classes for working with SQL query strings. */ module NoSQLQueryString { /** @@ -89,7 +84,7 @@ module NoSQL { MongoDbCollectionQueryString() { exists(Method meth, string methodName, int n | collectionMethods(methodName, n) and - meth.hasQualifiedName(mongoDb(), "Collection", methodName) and + meth.hasQualifiedName("go.mongodb.org/mongo-driver/mongo", "Collection", methodName) and this = meth.getACall().getArgument(n) ) } @@ -103,7 +98,7 @@ module NoSQL { // Taint an entry if the `Value` is tainted exists(Write w, DataFlow::Node base, Field f | w.writesField(base, f, pred) | base = succ.getASuccessor*() and - base.getType().hasQualifiedName(mongoBsonPrimitive(), "E") and + base.getType().hasQualifiedName("go.mongodb.org/mongo-driver/bson/primitive", "E") and f.getName() = "Value" ) }