@@ -167,23 +167,34 @@ class ExternalApiDataNode extends DataFlow::Node {
167
167
}
168
168
}
169
169
170
- /** A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s. */
171
- class UntrustedDataToExternalApiConfig extends TaintTracking:: Configuration {
170
+ /**
171
+ * DEPRECATED: Use `XmlBombFlow` module instead.
172
+ *
173
+ * A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s.
174
+ */
175
+ deprecated class UntrustedDataToExternalApiConfig extends TaintTracking:: Configuration {
172
176
UntrustedDataToExternalApiConfig ( ) { this = "UntrustedDataToExternalAPIConfig" }
173
177
174
178
override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
175
179
176
180
override predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
177
181
}
178
182
183
+ private module UntrustedDataToExternalApiConfig implements DataFlow:: ConfigSig {
184
+ predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
185
+
186
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
187
+ }
188
+
189
+ /** Global taint-tracking from `RemoteFlowSource`s to `ExternalApiDataNode`s. */
190
+ module UntrustedDataToExternalApiFlow = TaintTracking:: Global< UntrustedDataToExternalApiConfig > ;
191
+
179
192
/** A node representing untrusted data being passed to an external API. */
180
193
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
181
- UntrustedExternalApiDataNode ( ) { any ( UntrustedDataToExternalApiConfig c ) . hasFlow ( _, this ) }
194
+ UntrustedExternalApiDataNode ( ) { UntrustedDataToExternalApiFlow :: flow ( _, this ) }
182
195
183
196
/** Gets a source of untrusted data which is passed to this external API data node. */
184
- DataFlow:: Node getAnUntrustedSource ( ) {
185
- any ( UntrustedDataToExternalApiConfig c ) .hasFlow ( result , this )
186
- }
197
+ DataFlow:: Node getAnUntrustedSource ( ) { UntrustedDataToExternalApiFlow:: flow ( result , this ) }
187
198
}
188
199
189
200
/** An external API which is used with untrusted data. */
0 commit comments