@@ -21,8 +21,11 @@ module InsecureDownload {
21
21
abstract class Source extends DataFlow:: Node {
22
22
/**
23
23
* Gets a flow-label for this source.
24
+ * DEPRECATED: Use `getAFlowLabel()`
24
25
*/
25
- abstract DataFlow:: FlowState getALabel ( ) ;
26
+ abstract deprecated DataFlow:: FlowState getALabel ( ) ;
27
+
28
+ abstract Label:: State getAFlowLabel ( ) ;
26
29
}
27
30
28
31
/**
@@ -36,8 +39,11 @@ module InsecureDownload {
36
39
37
40
/**
38
41
* Gets a flow-label where this sink is vulnerable.
42
+ * DEPRECATED: Use `getAFlowLabel()`
39
43
*/
40
- abstract DataFlow:: FlowState getALabel ( ) ;
44
+ abstract deprecated DataFlow:: FlowState getALabel ( ) ;
45
+
46
+ abstract Label:: State getAFlowLabel ( ) ;
41
47
}
42
48
43
49
/**
@@ -51,24 +57,35 @@ module InsecureDownload {
51
57
module Label {
52
58
/**
53
59
* A flow-label for a URL that is downloaded over an insecure connection.
60
+ * DEPRECATED: Use `InsecureState()`
54
61
*/
55
- class Insecure extends DataFlow:: FlowState {
62
+ deprecated class Insecure extends DataFlow:: FlowState {
56
63
Insecure ( ) { this = "insecure" }
57
64
}
58
65
59
66
/**
60
67
* A flow-label for a URL that is sensitive.
68
+ * DEPRECATED: Use `SensitiveState()`
61
69
*/
62
- class Sensitive extends DataFlow:: FlowState {
70
+ deprecated class Sensitive extends DataFlow:: FlowState {
63
71
Sensitive ( ) { this = "sensitive" }
64
72
}
65
73
66
74
/**
67
75
* A flow-label for file URLs that are both sensitive and downloaded over an insecure connection.
76
+ * DEPRECATED: Use `SensitiveInsecureState()`
68
77
*/
69
- class SensitiveInsecure extends DataFlow:: FlowState {
78
+ deprecated class SensitiveInsecure extends DataFlow:: FlowState {
70
79
SensitiveInsecure ( ) { this = "sensitiveInsecure" }
71
80
}
81
+
82
+ /**
83
+ * Flow-labels for reasoning about download of sensitive file through insecure connection.
84
+ */
85
+ newtype State =
86
+ InsecureState ( ) or
87
+ SensitiveState ( ) or
88
+ SensitiveInsecureState ( )
72
89
}
73
90
74
91
/**
@@ -88,12 +105,19 @@ module InsecureDownload {
88
105
* seen as a source for downloads of sensitive files through an insecure connection.
89
106
*/
90
107
class InsecureFileUrl extends Source , InsecureUrl {
91
- override DataFlow:: FlowState getALabel ( ) {
108
+ deprecated override DataFlow:: FlowState getALabel ( ) {
92
109
result instanceof Label:: Insecure
93
110
or
94
111
hasUnsafeExtension ( str ) and
95
112
result instanceof Label:: SensitiveInsecure
96
113
}
114
+
115
+ override Label:: State getAFlowLabel ( ) {
116
+ result = Label:: InsecureState ( )
117
+ or
118
+ hasUnsafeExtension ( str ) and
119
+ result = Label:: SensitiveInsecureState ( )
120
+ }
97
121
}
98
122
99
123
/**
@@ -103,7 +127,9 @@ module InsecureDownload {
103
127
class SensitiveFileName extends Source {
104
128
SensitiveFileName ( ) { hasUnsafeExtension ( this .asExpr ( ) .getConstantValue ( ) .getString ( ) ) }
105
129
106
- override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Sensitive }
130
+ deprecated override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Sensitive }
131
+
132
+ override Label:: State getAFlowLabel ( ) { result = Label:: SensitiveState ( ) }
107
133
}
108
134
109
135
/**
@@ -145,11 +171,17 @@ module InsecureDownload {
145
171
146
172
override DataFlow:: Node getDownloadCall ( ) { result = req }
147
173
148
- override DataFlow:: FlowState getALabel ( ) {
174
+ deprecated override DataFlow:: FlowState getALabel ( ) {
149
175
result instanceof Label:: SensitiveInsecure
150
176
or
151
177
any ( req .getAUrlPart ( ) ) instanceof InsecureUrl and result instanceof Label:: Sensitive
152
178
}
179
+
180
+ override Label:: State getAFlowLabel ( ) {
181
+ result = Label:: SensitiveInsecureState ( )
182
+ or
183
+ any ( req .getAUrlPart ( ) ) instanceof InsecureUrl and result = Label:: SensitiveState ( )
184
+ }
153
185
}
154
186
155
187
/**
@@ -191,7 +223,9 @@ module InsecureDownload {
191
223
)
192
224
}
193
225
194
- override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Insecure }
226
+ deprecated override DataFlow:: FlowState getALabel ( ) { result instanceof Label:: Insecure }
227
+
228
+ override Label:: State getAFlowLabel ( ) { result = Label:: InsecureState ( ) }
195
229
196
230
override DataFlow:: Node getDownloadCall ( ) { result = request }
197
231
}
0 commit comments