@@ -167,23 +167,34 @@ class ExternalApiDataNode extends DataFlow::Node {
167167 }
168168}
169169
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 {
172176 UntrustedDataToExternalApiConfig ( ) { this = "UntrustedDataToExternalAPIConfig" }
173177
174178 override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
175179
176180 override predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
177181}
178182
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+
179192/** A node representing untrusted data being passed to an external API. */
180193class UntrustedExternalApiDataNode extends ExternalApiDataNode {
181- UntrustedExternalApiDataNode ( ) { any ( UntrustedDataToExternalApiConfig c ) . hasFlow ( _, this ) }
194+ UntrustedExternalApiDataNode ( ) { UntrustedDataToExternalApiFlow :: flow ( _, this ) }
182195
183196 /** 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 ) }
187198}
188199
189200/** An external API which is used with untrusted data. */
0 commit comments