Skip to content

Commit 12dab88

Browse files
committed
Python: rename concept
`NoSqlQuery` -> `NoSqlExecution`
1 parent 4ec8b3f commit 12dab88

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

python/ql/lib/semmle/python/Concepts.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ module SqlExecution {
379379
}
380380

381381
/** Provides a class for modeling NoSql execution APIs. */
382-
module NoSqlQuery {
382+
module NoSqlExecution {
383383
/**
384384
* A data-flow node that executes NoSQL queries.
385385
*
@@ -404,7 +404,7 @@ module NoSqlQuery {
404404
* Extend this class to refine existing API models. If you want to model new APIs,
405405
* extend `NoSQLQuery::Range` instead.
406406
*/
407-
class NoSqlQuery extends DataFlow::Node instanceof NoSqlQuery::Range {
407+
class NoSqlExecution extends DataFlow::Node instanceof NoSqlExecution::Range {
408408
/** Gets the argument that specifies the NoSql query to be executed. */
409409
DataFlow::Node getQuery() { result = super.getQuery() }
410410

python/ql/lib/semmle/python/frameworks/NoSQL.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private module NoSql {
110110
*
111111
* `mongo.db.user.find({'name': safe_search})` would be a collection method call.
112112
*/
113-
private class MongoCollectionCall extends DataFlow::CallCfgNode, NoSqlQuery::Range {
113+
private class MongoCollectionCall extends DataFlow::CallCfgNode, NoSqlExecution::Range {
114114
MongoCollectionCall() {
115115
this = mongoCollection().getMember(mongoCollectionMethodName()).getACall()
116116
}
@@ -122,7 +122,7 @@ private module NoSql {
122122
override predicate vulnerableToStrings() { none() }
123123
}
124124

125-
private class MongoCollectionAggregation extends API::CallNode, NoSqlQuery::Range {
125+
private class MongoCollectionAggregation extends API::CallNode, NoSqlExecution::Range {
126126
MongoCollectionAggregation() { this = mongoCollection().getMember("aggregate").getACall() }
127127

128128
override DataFlow::Node getQuery() { result = this.getParameter(0).getASubscript().asSink() }
@@ -132,7 +132,7 @@ private module NoSql {
132132
override predicate vulnerableToStrings() { none() }
133133
}
134134

135-
private class MongoMapReduce extends API::CallNode, NoSqlQuery::Range {
135+
private class MongoMapReduce extends API::CallNode, NoSqlExecution::Range {
136136
MongoMapReduce() { this = mongoCollection().getMember("map_reduce").getACall() }
137137

138138
override DataFlow::Node getQuery() { result in [this.getArg(0), this.getArg(1)] }
@@ -142,7 +142,7 @@ private module NoSql {
142142
override predicate vulnerableToStrings() { any() }
143143
}
144144

145-
private class MongoMapReduceQuery extends API::CallNode, NoSqlQuery::Range {
145+
private class MongoMapReduceQuery extends API::CallNode, NoSqlExecution::Range {
146146
MongoMapReduceQuery() { this = mongoCollection().getMember("map_reduce").getACall() }
147147

148148
override DataFlow::Node getQuery() { result in [this.getArgByName("query")] }
@@ -248,7 +248,7 @@ private module NoSql {
248248
*
249249
* `Movie.objects(__raw__=json_search)` would be the result.
250250
*/
251-
private class MongoEngineObjectsCall extends DataFlow::CallCfgNode, NoSqlQuery::Range {
251+
private class MongoEngineObjectsCall extends DataFlow::CallCfgNode, NoSqlExecution::Range {
252252
MongoEngineObjectsCall() {
253253
this =
254254
[mongoEngine(), flask_MongoEngine()]

python/ql/lib/semmle/python/security/dataflow/NoSQLInjectionCustomizations.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ module NoSqlInjection {
6060
class RemoteFlowSourceAsStringSource extends RemoteFlowSource, StringSource { }
6161

6262
/** A NoSQL query that is vulnerable to user controlled strings. */
63-
class NoSqlQueryAsStringSink extends StringSink {
64-
NoSqlQueryAsStringSink() {
65-
exists(NoSqlQuery noSqlQuery | this = noSqlQuery.getQuery() |
66-
noSqlQuery.vulnerableToStrings()
63+
class NoSqlExecutionAsStringSink extends StringSink {
64+
NoSqlExecutionAsStringSink() {
65+
exists(NoSqlExecution noSqlExecution | this = noSqlExecution.getQuery() |
66+
noSqlExecution.vulnerableToStrings()
6767
)
6868
}
6969
}
7070

7171
/** A NoSQL query that is vulnerable to user controlled dictionaries. */
72-
class NoSqlQueryAsDictSink extends DictSink {
73-
NoSqlQueryAsDictSink() { this = any(NoSqlQuery noSqlQuery).getQuery() }
72+
class NoSqlExecutionAsDictSink extends DictSink {
73+
NoSqlExecutionAsDictSink() { this = any(NoSqlExecution noSqlExecution).getQuery() }
7474
}
7575

7676
/** A JSON decoding converts a string to a dictionary. */

0 commit comments

Comments
 (0)