Catch any keyword argument passed to MongoEngine's objects method

After some research, we discovered that any keyword argument passed to the objects method will result in NoSQL injection. This includes scenarios where we have the following:

objects(name_of_model_attribute=unsanitized_user_input)
This commit is contained in:
thank_you
2021-04-07 16:45:48 -04:00
parent 719c30bd92
commit 83f28bfdda

View File

@@ -63,7 +63,7 @@ private module NoSQL {
.getACall()
}
override DataFlow::Node getQueryNode() { result = this.getArgByName("__raw__") }
override DataFlow::Node getQueryNode() { result = this.getArgByName(any(string name)) }
}
private class MongoSanitizerCall extends DataFlow::CallCfgNode, NoSQLSanitizer::Range {