@@ -5,7 +5,7 @@ private import Common
5
5
/**
6
6
* An extensible kind of taint representing an externally controlled string.
7
7
*/
8
- abstract class ExternalStringKind extends StringKind {
8
+ abstract deprecated class ExternalStringKind extends StringKind {
9
9
bindingset [ this ]
10
10
ExternalStringKind ( ) { this = this }
11
11
@@ -30,15 +30,15 @@ abstract class ExternalStringKind extends StringKind {
30
30
}
31
31
32
32
/** A kind of "taint", representing a sequence, with a "taint" member */
33
- class ExternalStringSequenceKind extends SequenceKind {
33
+ deprecated class ExternalStringSequenceKind extends SequenceKind {
34
34
ExternalStringSequenceKind ( ) { this .getItem ( ) instanceof ExternalStringKind }
35
35
}
36
36
37
37
/**
38
38
* An hierachical dictionary or list where the entire structure is externally controlled
39
39
* This is typically a parsed JSON object.
40
40
*/
41
- class ExternalJsonKind extends TaintKind {
41
+ deprecated class ExternalJsonKind extends TaintKind {
42
42
ExternalJsonKind ( ) { this = "json[" + any ( ExternalStringKind key ) + "]" }
43
43
44
44
/** Gets the taint kind for item in this sequence */
@@ -61,20 +61,20 @@ class ExternalJsonKind extends TaintKind {
61
61
}
62
62
63
63
/** A kind of "taint", representing a dictionary mapping keys to tainted strings. */
64
- class ExternalStringDictKind extends DictKind {
64
+ deprecated class ExternalStringDictKind extends DictKind {
65
65
ExternalStringDictKind ( ) { this .getValue ( ) instanceof ExternalStringKind }
66
66
}
67
67
68
68
/**
69
69
* A kind of "taint", representing a dictionary mapping keys to sequences of
70
70
* tainted strings.
71
71
*/
72
- class ExternalStringSequenceDictKind extends DictKind {
72
+ deprecated class ExternalStringSequenceDictKind extends DictKind {
73
73
ExternalStringSequenceDictKind ( ) { this .getValue ( ) instanceof ExternalStringSequenceKind }
74
74
}
75
75
76
76
/** TaintKind for the result of `urlsplit(tainted_string)` */
77
- class ExternalUrlSplitResult extends ExternalStringSequenceKind {
77
+ deprecated class ExternalUrlSplitResult extends ExternalStringSequenceKind {
78
78
// https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlsplit
79
79
override TaintKind getTaintOfAttribute ( string name ) {
80
80
result = super .getTaintOfAttribute ( name )
@@ -103,7 +103,7 @@ class ExternalUrlSplitResult extends ExternalStringSequenceKind {
103
103
}
104
104
105
105
/** TaintKind for the result of `urlparse(tainted_string)` */
106
- class ExternalUrlParseResult extends ExternalStringSequenceKind {
106
+ deprecated class ExternalUrlParseResult extends ExternalStringSequenceKind {
107
107
// https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse
108
108
override TaintKind getTaintOfAttribute ( string name ) {
109
109
result = super .getTaintOfAttribute ( name )
@@ -134,20 +134,20 @@ class ExternalUrlParseResult extends ExternalStringSequenceKind {
134
134
135
135
/* Helper for getTaintForStep() */
136
136
pragma [ noinline]
137
- private predicate json_subscript_taint (
137
+ deprecated deprecated private predicate json_subscript_taint (
138
138
SubscriptNode sub , ControlFlowNode obj , ExternalJsonKind seq , TaintKind key
139
139
) {
140
140
sub .isLoad ( ) and
141
141
sub .getObject ( ) = obj and
142
142
key = seq .getValue ( )
143
143
}
144
144
145
- private predicate json_load ( ControlFlowNode fromnode , CallNode tonode ) {
145
+ deprecated private predicate json_load ( ControlFlowNode fromnode , CallNode tonode ) {
146
146
tonode = Value:: named ( "json.loads" ) .getACall ( ) and
147
147
tonode .getArg ( 0 ) = fromnode
148
148
}
149
149
150
- private predicate urlsplit ( ControlFlowNode fromnode , CallNode tonode ) {
150
+ deprecated private predicate urlsplit ( ControlFlowNode fromnode , CallNode tonode ) {
151
151
// This could be implemented as `exists(FunctionValue` without the explicit six part,
152
152
// but then our tests will need to import +100 modules, so for now this slightly
153
153
// altered version gets to live on.
@@ -166,7 +166,7 @@ private predicate urlsplit(ControlFlowNode fromnode, CallNode tonode) {
166
166
)
167
167
}
168
168
169
- private predicate urlparse ( ControlFlowNode fromnode , CallNode tonode ) {
169
+ deprecated private predicate urlparse ( ControlFlowNode fromnode , CallNode tonode ) {
170
170
// This could be implemented as `exists(FunctionValue` without the explicit six part,
171
171
// but then our tests will need to import +100 modules, so for now this slightly
172
172
// altered version gets to live on.
@@ -185,7 +185,7 @@ private predicate urlparse(ControlFlowNode fromnode, CallNode tonode) {
185
185
)
186
186
}
187
187
188
- private predicate parse_qs ( ControlFlowNode fromnode , CallNode tonode ) {
188
+ deprecated private predicate parse_qs ( ControlFlowNode fromnode , CallNode tonode ) {
189
189
// This could be implemented as `exists(FunctionValue` without the explicit six part,
190
190
// but then our tests will need to import +100 modules, so for now this slightly
191
191
// altered version gets to live on.
@@ -211,7 +211,7 @@ private predicate parse_qs(ControlFlowNode fromnode, CallNode tonode) {
211
211
)
212
212
}
213
213
214
- private predicate parse_qsl ( ControlFlowNode fromnode , CallNode tonode ) {
214
+ deprecated private predicate parse_qsl ( ControlFlowNode fromnode , CallNode tonode ) {
215
215
// This could be implemented as `exists(FunctionValue` without the explicit six part,
216
216
// but then our tests will need to import +100 modules, so for now this slightly
217
217
// altered version gets to live on.
@@ -238,7 +238,7 @@ private predicate parse_qsl(ControlFlowNode fromnode, CallNode tonode) {
238
238
}
239
239
240
240
/** A kind of "taint", representing an open file-like object from an external source. */
241
- class ExternalFileObject extends TaintKind {
241
+ deprecated class ExternalFileObject extends TaintKind {
242
242
ExternalStringKind valueKind ;
243
243
244
244
ExternalFileObject ( ) { this = "file[" + valueKind + "]" }
@@ -266,7 +266,7 @@ class ExternalFileObject extends TaintKind {
266
266
* - `if splitres.netloc == "KNOWN_VALUE"`
267
267
* - `if splitres[0] == "KNOWN_VALUE"`
268
268
*/
269
- class UrlsplitUrlparseTempSanitizer extends Sanitizer {
269
+ deprecated class UrlsplitUrlparseTempSanitizer extends Sanitizer {
270
270
// TODO: remove this once we have better support for named tuples
271
271
UrlsplitUrlparseTempSanitizer ( ) { this = "UrlsplitUrlparseTempSanitizer" }
272
272
0 commit comments