Skip to content

Commit 528f08f

Browse files
committed
Python: Make queries use ActiveThreatModelSource
1 parent 8f7dec0 commit 528f08f

19 files changed

+128
-37
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ module CodeInjection {
3333
abstract class Sanitizer extends DataFlow::Node { }
3434

3535
/**
36-
* A source of remote user input, considered as a flow source.
36+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3737
*/
38-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
38+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
39+
40+
/**
41+
* An active threat-model source, considered as a flow source.
42+
*/
43+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3944

4045
/**
4146
* A code execution, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ module CommandInjection {
3333
abstract class Sanitizer extends DataFlow::Node { }
3434

3535
/**
36-
* A source of remote user input, considered as a flow source.
36+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3737
*/
38-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
38+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
39+
40+
/**
41+
* An active threat-model source, considered as a flow source.
42+
*/
43+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3944

4045
/**
4146
* A command execution, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ module CookieInjection {
3131
abstract class Sanitizer extends DataFlow::Node { }
3232

3333
/**
34-
* A source of remote user input, considered as a flow source.
34+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3535
*/
36-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
36+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
37+
38+
/**
39+
* An active threat-model source, considered as a flow source.
40+
*/
41+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3742

3843
/**
3944
* A write to a cookie, considered as a sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ module HttpHeaderInjection {
3232
abstract class Sanitizer extends DataFlow::Node { }
3333

3434
/**
35-
* A source of remote user input, considered as a flow source.
35+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3636
*/
37-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
37+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
38+
39+
/**
40+
* An active threat-model source, considered as a flow source.
41+
*/
42+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3843

3944
/**
4045
* A HTTP header write, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ module LdapInjection {
4242
abstract class FilterSanitizer extends DataFlow::Node { }
4343

4444
/**
45-
* A source of remote user input, considered as a flow source.
45+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
4646
*/
47-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
47+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
48+
49+
/**
50+
* An active threat-model source, considered as a flow source.
51+
*/
52+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
4853

4954
/**
5055
* A logging operation, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ module LogInjection {
3333
abstract class Sanitizer extends DataFlow::Node { }
3434

3535
/**
36-
* A source of remote user input, considered as a flow source.
36+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3737
*/
38-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
38+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
39+
40+
/**
41+
* An active threat-model source, considered as a flow source.
42+
*/
43+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3944

4045
/**
4146
* A logging operation, considered as a flow sink.

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import python
77
import semmle.python.ApiGraphs
88
import semmle.python.dataflow.new.TaintTracking
99
import semmle.python.dataflow.new.RemoteFlowSources
10+
import semmle.python.Concepts
1011

1112
/**
1213
* Provides default sources, sinks and sanitizers for detecting
@@ -39,9 +40,14 @@ module PamAuthorizationCustomizations {
3940
abstract class Sink extends DataFlow::Node { }
4041

4142
/**
42-
* A source of remote user input, considered as a flow source.
43+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
4344
*/
44-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
45+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
46+
47+
/**
48+
* An active threat-model source, considered as a flow source.
49+
*/
50+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
4551

4652
/**
4753
* A vulnerable `pam_authenticate` call considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ module PathInjection {
4343
abstract class Sanitizer extends DataFlow::Node { }
4444

4545
/**
46-
* A source of remote user input, considered as a flow source.
46+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
4747
*/
48-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
48+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
49+
50+
/**
51+
* An active threat-model source, considered as a flow source.
52+
*/
53+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
4954

5055
/**
5156
* A file system access, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ module PolynomialReDoS {
4747
abstract class Sanitizer extends DataFlow::Node { }
4848

4949
/**
50-
* A source of remote user input, considered as a flow source.
50+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
5151
*/
52-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
52+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
53+
54+
/**
55+
* An active threat-model source, considered as a flow source.
56+
*/
57+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
5358

5459
/**
5560
* A regex execution, considered as a flow sink.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ module ReflectedXss {
3333
abstract class Sanitizer extends DataFlow::Node { }
3434

3535
/**
36-
* A source of remote user input, considered as a flow source.
36+
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
3737
*/
38-
class RemoteFlowSourceAsSource extends Source, RemoteFlowSource { }
38+
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
39+
40+
/**
41+
* An active threat-model source, considered as a flow source.
42+
*/
43+
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
3944

4045
/**
4146
* A data flow sink for "reflected cross-site scripting" vulnerabilities.

0 commit comments

Comments
 (0)