@@ -90,26 +90,38 @@ class ExternalApiDataNode extends DataFlow::Node {
90
90
/** DEPRECATED: Alias for ExternalApiDataNode */
91
91
deprecated class ExternalAPIDataNode = ExternalApiDataNode ;
92
92
93
- /** A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s. */
94
- class UntrustedDataToExternalApiConfig extends TaintTracking:: Configuration {
93
+ /**
94
+ * DEPRECATED: Use `RemoteSourceToExternalApi` instead.
95
+ *
96
+ * A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s.
97
+ */
98
+ deprecated class UntrustedDataToExternalApiConfig extends TaintTracking:: Configuration {
95
99
UntrustedDataToExternalApiConfig ( ) { this = "UntrustedDataToExternalAPIConfig" }
96
100
97
101
override predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
98
102
99
103
override predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
100
104
}
101
105
106
+ /** A configuration for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s. */
107
+ private module RemoteSourceToExternalApiConfig implements DataFlow:: ConfigSig {
108
+ predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
109
+
110
+ predicate isSink ( DataFlow:: Node sink ) { sink instanceof ExternalApiDataNode }
111
+ }
112
+
113
+ /** A module for tracking flow from `RemoteFlowSource`s to `ExternalApiDataNode`s. */
114
+ module RemoteSourceToExternalApi = TaintTracking:: Global< RemoteSourceToExternalApiConfig > ;
115
+
102
116
/** DEPRECATED: Alias for UntrustedDataToExternalApiConfig */
103
117
deprecated class UntrustedDataToExternalAPIConfig = UntrustedDataToExternalApiConfig ;
104
118
105
119
/** A node representing untrusted data being passed to an external API. */
106
120
class UntrustedExternalApiDataNode extends ExternalApiDataNode {
107
- private UntrustedDataToExternalApiConfig c ;
108
-
109
- UntrustedExternalApiDataNode ( ) { c .hasFlow ( _, this ) }
121
+ UntrustedExternalApiDataNode ( ) { RemoteSourceToExternalApi:: flow ( _, this ) }
110
122
111
123
/** Gets a source of untrusted data which is passed to this external API data node. */
112
- DataFlow:: Node getAnUntrustedSource ( ) { c . hasFlow ( result , this ) }
124
+ DataFlow:: Node getAnUntrustedSource ( ) { RemoteSourceToExternalApi :: flow ( result , this ) }
113
125
}
114
126
115
127
/** DEPRECATED: Alias for UntrustedExternalApiDataNode */
0 commit comments