@@ -7,7 +7,6 @@ private import codeql.ruby.CFG
7
7
private import codeql.ruby.Concepts
8
8
private import codeql.ruby.ApiGraphs
9
9
private import codeql.ruby.DataFlow
10
- private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries as DataFlowImplForHttpClientLibraries
11
10
12
11
/**
13
12
* A call that makes an HTTP request using `Excon`.
@@ -72,8 +71,7 @@ class ExconHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode
72
71
override predicate disablesCertificateValidation (
73
72
DataFlow:: Node disablingNode , DataFlow:: Node argumentOrigin
74
73
) {
75
- any ( ExconDisablesCertificateValidationConfiguration config )
76
- .hasFlow ( argumentOrigin , disablingNode ) and
74
+ ExconDisablesCertificateValidationFlow:: flow ( argumentOrigin , disablingNode ) and
77
75
disablingNode = this .getCertificateValidationControllingValue ( )
78
76
or
79
77
// We set `Excon.defaults[:ssl_verify_peer]` or `Excon.ssl_verify_peer` = false`
@@ -114,17 +112,13 @@ class ExconHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode
114
112
}
115
113
116
114
/** A configuration to track values that can disable certificate validation for Excon. */
117
- private class ExconDisablesCertificateValidationConfiguration extends DataFlowImplForHttpClientLibraries:: Configuration
118
- {
119
- ExconDisablesCertificateValidationConfiguration ( ) {
120
- this = "ExconDisablesCertificateValidationConfiguration"
121
- }
122
-
123
- override predicate isSource ( DataFlow:: Node source ) {
124
- source .asExpr ( ) .getExpr ( ) .( BooleanLiteral ) .isFalse ( )
125
- }
115
+ private module ExconDisablesCertificateValidationConfig implements DataFlow:: ConfigSig {
116
+ predicate isSource ( DataFlow:: Node source ) { source .asExpr ( ) .getExpr ( ) .( BooleanLiteral ) .isFalse ( ) }
126
117
127
- override predicate isSink ( DataFlow:: Node sink ) {
118
+ predicate isSink ( DataFlow:: Node sink ) {
128
119
sink = any ( ExconHttpRequest req ) .getCertificateValidationControllingValue ( )
129
120
}
130
121
}
122
+
123
+ private module ExconDisablesCertificateValidationFlow =
124
+ DataFlow:: Global< ExconDisablesCertificateValidationConfig > ;
0 commit comments