@@ -20,7 +20,46 @@ app.post('/documents/find', (req, res) => {
2020 const query = { } ;
2121 query . title = req . body . title ;
2222
23+ // NOT OK: query is tainted by user-provided object value
24+ Document . aggregate ( 'type' , query ) ;
25+
26+ // NOT OK: query is tainted by user-provided object value
27+ Document . count ( query ) ;
28+
29+ // NOT OK: query is tainted by user-provided object value
30+ Document . deleteMany ( query ) ;
31+
32+ // NOT OK: query is tainted by user-provided object value
33+ Document . deleteOne ( query ) ;
34+
35+ // NOT OK: query is tainted by user-provided object value
36+ Document . distinct ( 'type' , query ) ;
37+
2338 // NOT OK: query is tainted by user-provided object value
2439 Document . find ( query ) ;
40+
41+ // NOT OK: query is tainted by user-provided object value
42+ Document . findOne ( query ) ;
43+
44+ // NOT OK: query is tainted by user-provided object value
45+ Document . findOneAndDelete ( query ) ;
46+
47+ // NOT OK: query is tainted by user-provided object value
48+ Document . findOneAndRemove ( query ) ;
49+
50+ // NOT OK: query is tainted by user-provided object value
51+ Document . findOneAndUpdate ( query ) ;
52+
53+ // NOT OK: query is tainted by user-provided object value
54+ Document . replaceOne ( query ) ;
55+
56+ // NOT OK: query is tainted by user-provided object value
57+ Document . update ( query ) ;
58+
59+ // NOT OK: query is tainted by user-provided object value
60+ Document . updateMany ( query ) ;
61+
62+ // NOT OK: query is tainted by user-provided object value
63+ Document . updateOne ( query ) ;
2564} ) ;
2665
0 commit comments