Skip to content

Commit 55707d3

Browse files
committed
Python: Make things compile in their new location
- Move NoSQL concepts to the non-experimental concepts file - fix references
1 parent 60dc1af commit 55707d3

File tree

6 files changed

+53
-54
lines changed

6 files changed

+53
-54
lines changed

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,56 @@ module SqlExecution {
378378
}
379379
}
380380

381+
/** Provides a class for modeling NoSql execution APIs. */
382+
module NoSqlQuery {
383+
/**
384+
* A data-flow node that executes NoSQL queries.
385+
*
386+
* Extend this class to model new APIs. If you want to refine existing API models,
387+
* extend `NoSQLQuery` instead.
388+
*/
389+
abstract class Range extends DataFlow::Node {
390+
/** Gets the argument that specifies the NoSql query to be executed. */
391+
abstract DataFlow::Node getQuery();
392+
}
393+
}
394+
395+
/**
396+
* A data-flow node that executes NoSQL queries.
397+
*
398+
* Extend this class to refine existing API models. If you want to model new APIs,
399+
* extend `NoSQLQuery::Range` instead.
400+
*/
401+
class NoSqlQuery extends DataFlow::Node instanceof NoSqlQuery::Range {
402+
/** Gets the argument that specifies the NoSql query to be executed. */
403+
DataFlow::Node getQuery() { result = super.getQuery() }
404+
}
405+
406+
/** Provides classes for modeling NoSql sanitization-related APIs. */
407+
module NoSqlSanitizer {
408+
/**
409+
* A data-flow node that collects functions sanitizing NoSQL queries.
410+
*
411+
* Extend this class to model new APIs. If you want to refine existing API models,
412+
* extend `NoSQLSanitizer` instead.
413+
*/
414+
abstract class Range extends DataFlow::Node {
415+
/** Gets the argument that specifies the NoSql query to be sanitized. */
416+
abstract DataFlow::Node getAnInput();
417+
}
418+
}
419+
420+
/**
421+
* A data-flow node that collects functions sanitizing NoSQL queries.
422+
*
423+
* Extend this class to model new APIs. If you want to refine existing API models,
424+
* extend `NoSQLSanitizer::Range` instead.
425+
*/
426+
class NoSqlSanitizer extends DataFlow::Node instanceof NoSqlSanitizer::Range {
427+
/** Gets the argument that specifies the NoSql query to be sanitized. */
428+
DataFlow::Node getAnInput() { result = super.getAnInput() }
429+
}
430+
381431
/**
382432
* A data-flow node that executes a regular expression.
383433
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private import python
77
private import semmle.python.dataflow.new.DataFlow
88
private import semmle.python.dataflow.new.TaintTracking
99
private import semmle.python.dataflow.new.RemoteFlowSources
10-
private import experimental.semmle.python.Concepts
10+
private import semmle.python.Concepts
1111
private import semmle.python.ApiGraphs
1212

1313
private module NoSql {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import python
22
import semmle.python.dataflow.new.DataFlow
33
import semmle.python.dataflow.new.TaintTracking
44
import semmle.python.dataflow.new.RemoteFlowSources
5-
import experimental.semmle.python.Concepts
65
import semmle.python.Concepts
76

87
module NoSqlInjection {

python/ql/src/Security/CWE-943/NoSQLInjection.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212

1313
import python
14-
import experimental.semmle.python.security.injection.NoSQLInjection
14+
import semmle.python.security.dataflow.NoSQLInjection
1515
import DataFlow::PathGraph
1616

1717
from NoSqlInjection::Configuration config, DataFlow::PathNode source, DataFlow::PathNode sink

python/ql/src/experimental/semmle/python/Concepts.qll

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -216,56 +216,6 @@ class SqlEscape extends DataFlow::Node instanceof SqlEscape::Range {
216216
DataFlow::Node getAnInput() { result = super.getAnInput() }
217217
}
218218

219-
/** Provides a class for modeling NoSql execution APIs. */
220-
module NoSqlQuery {
221-
/**
222-
* A data-flow node that executes NoSQL queries.
223-
*
224-
* Extend this class to model new APIs. If you want to refine existing API models,
225-
* extend `NoSQLQuery` instead.
226-
*/
227-
abstract class Range extends DataFlow::Node {
228-
/** Gets the argument that specifies the NoSql query to be executed. */
229-
abstract DataFlow::Node getQuery();
230-
}
231-
}
232-
233-
/**
234-
* A data-flow node that executes NoSQL queries.
235-
*
236-
* Extend this class to refine existing API models. If you want to model new APIs,
237-
* extend `NoSQLQuery::Range` instead.
238-
*/
239-
class NoSqlQuery extends DataFlow::Node instanceof NoSqlQuery::Range {
240-
/** Gets the argument that specifies the NoSql query to be executed. */
241-
DataFlow::Node getQuery() { result = super.getQuery() }
242-
}
243-
244-
/** Provides classes for modeling NoSql sanitization-related APIs. */
245-
module NoSqlSanitizer {
246-
/**
247-
* A data-flow node that collects functions sanitizing NoSQL queries.
248-
*
249-
* Extend this class to model new APIs. If you want to refine existing API models,
250-
* extend `NoSQLSanitizer` instead.
251-
*/
252-
abstract class Range extends DataFlow::Node {
253-
/** Gets the argument that specifies the NoSql query to be sanitized. */
254-
abstract DataFlow::Node getAnInput();
255-
}
256-
}
257-
258-
/**
259-
* A data-flow node that collects functions sanitizing NoSQL queries.
260-
*
261-
* Extend this class to model new APIs. If you want to refine existing API models,
262-
* extend `NoSQLSanitizer::Range` instead.
263-
*/
264-
class NoSqlSanitizer extends DataFlow::Node instanceof NoSqlSanitizer::Range {
265-
/** Gets the argument that specifies the NoSql query to be sanitized. */
266-
DataFlow::Node getAnInput() { result = super.getAnInput() }
267-
}
268-
269219
/** Provides classes for modeling HTTP Header APIs. */
270220
module HeaderDeclaration {
271221
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
experimental/Security/CWE-943/NoSQLInjection.ql
1+
Security/CWE-943/NoSQLInjection.ql

0 commit comments

Comments
 (0)