mirror of
https://github.com/github/codeql.git
synced 2025-12-20 02:44:30 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user