@@ -6,7 +6,6 @@ private import codeql.ruby.AST
6
6
private import codeql.ruby.Concepts
7
7
private import codeql.ruby.ApiGraphs
8
8
private import codeql.ruby.DataFlow
9
- private import codeql.ruby.dataflow.internal.DataFlowImplForHttpClientLibraries as DataFlowImplForHttpClientLibraries
10
9
11
10
/**
12
11
* A call that makes an HTTP request using `HTTPClient`.
@@ -65,26 +64,23 @@ class HttpClientRequest extends Http::Client::Request::Range, DataFlow::CallNode
65
64
override predicate disablesCertificateValidation (
66
65
DataFlow:: Node disablingNode , DataFlow:: Node argumentOrigin
67
66
) {
68
- any ( HttpClientDisablesCertificateValidationConfiguration config )
69
- .hasFlow ( argumentOrigin , disablingNode ) and
67
+ HttpClientDisablesCertificateValidationFlow:: flow ( argumentOrigin , disablingNode ) and
70
68
disablingNode = this .getCertificateValidationControllingValue ( )
71
69
}
72
70
73
71
override string getFramework ( ) { result = "HTTPClient" }
74
72
}
75
73
76
74
/** A configuration to track values that can disable certificate validation for HttpClient. */
77
- private class HttpClientDisablesCertificateValidationConfiguration extends DataFlowImplForHttpClientLibraries:: Configuration
78
- {
79
- HttpClientDisablesCertificateValidationConfiguration ( ) {
80
- this = "HttpClientDisablesCertificateValidationConfiguration"
81
- }
82
-
83
- override predicate isSource ( DataFlow:: Node source ) {
75
+ private module HttpClientDisablesCertificateValidationConfig implements DataFlow:: ConfigSig {
76
+ predicate isSource ( DataFlow:: Node source ) {
84
77
source = API:: getTopLevelMember ( "OpenSSL" ) .getMember ( "SSL" ) .getMember ( "VERIFY_NONE" ) .asSource ( )
85
78
}
86
79
87
- override predicate isSink ( DataFlow:: Node sink ) {
80
+ predicate isSink ( DataFlow:: Node sink ) {
88
81
sink = any ( HttpClientRequest req ) .getCertificateValidationControllingValue ( )
89
82
}
90
83
}
84
+
85
+ private module HttpClientDisablesCertificateValidationFlow =
86
+ DataFlow:: Global< HttpClientDisablesCertificateValidationConfig > ;
0 commit comments