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