Skip to content

Commit 2a87d53

Browse files
committed
JS: Add additional Mongoose/MongoDB sinks
1 parent 8d8148d commit 2a87d53

File tree

1 file changed

+14
-1
lines changed
  • javascript/ql/src/semmle/javascript/frameworks

1 file changed

+14
-1
lines changed

javascript/ql/src/semmle/javascript/frameworks/NoSQL.qll

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,22 @@ private module MongoDB {
6262

6363
QueryCall() {
6464
exists (string m | asExpr().(MethodCallExpr).calls(any(Collection c), m) |
65+
m = "aggregate" and queryArgIdx = 0 or
6566
m = "count" and queryArgIdx = 0 or
67+
m = "deleteMany" and queryArgIdx = 0 or
68+
m = "deleteOne" and queryArgIdx = 0 or
6669
m = "distinct" and queryArgIdx = 1 or
67-
m = "find" and queryArgIdx = 0
70+
m = "find" and queryArgIdx = 0 or
71+
m = "findOne" and queryArgIdx = 0 or
72+
m = "findOneAndDelete" and queryArgIdx = 0 or
73+
m = "findOneAndRemove" and queryArgIdx = 0 or
74+
m = "findOneAndDelete" and queryArgIdx = 0 or
75+
m = "findOneAndUpdate" and queryArgIdx = 0 or
76+
m = "remove" and queryArgIdx = 0 or
77+
m = "replaceOne" and queryArgIdx = 0 or
78+
m = "update" and queryArgIdx = 0 or
79+
m = "updateMany" and queryArgIdx = 0 or
80+
m = "updateOne" and queryArgIdx = 0
6881
)
6982
}
7083

0 commit comments

Comments
 (0)