Skip to content

Commit 4dc632f

Browse files
committed
Ruby: mass enable diff-informed data flow
1 parent 498bfd2 commit 4dc632f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+159
-0
lines changed

ruby/ql/lib/codeql/ruby/experimental/UnicodeBypassValidationQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ private module UnicodeBypassValidationConfig implements DataFlow::StateConfigSig
158158
) and
159159
state = PostValidationState()
160160
}
161+
162+
predicate observeDiffInformedIncrementalMode() { any() }
161163
}
162164

163165
/**

ruby/ql/lib/codeql/ruby/experimental/ZipSlipQuery.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ private module ZipSlipConfig implements DataFlow::ConfigSig {
2929
}
3030

3131
predicate isBarrier(DataFlow::Node node) { node instanceof ZipSlip::Sanitizer }
32+
33+
predicate observeDiffInformedIncrementalMode() { any() }
3234
}
3335

3436
/**

ruby/ql/lib/codeql/ruby/frameworks/http_clients/Excon.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ private module ExconDisablesCertificateValidationConfig implements DataFlow::Con
118118
predicate isSink(DataFlow::Node sink) {
119119
sink = any(ExconHttpRequest req).getCertificateValidationControllingValue()
120120
}
121+
122+
predicate observeDiffInformedIncrementalMode() {
123+
// TODO(diff-informed): Manually verify if config can be diff-informed.
124+
// lib/codeql/ruby/frameworks/http_clients/Excon.qll:74: Flow call outside 'select' clause
125+
none()
126+
}
121127
}
122128

123129
private module ExconDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/Faraday.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ private module FaradayDisablesCertificateValidationConfig implements DataFlow::S
9999
predicate isSink(DataFlow::Node sink, FlowState state) {
100100
sink = any(FaradayHttpRequest req).getCertificateValidationControllingValue(state)
101101
}
102+
103+
predicate observeDiffInformedIncrementalMode() {
104+
// TODO(diff-informed): Manually verify if config can be diff-informed.
105+
// lib/codeql/ruby/frameworks/http_clients/Faraday.qll:80: Flow call outside 'select' clause
106+
none()
107+
}
102108
}
103109

104110
private module FaradayDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/HttpClient.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ private module HttpClientDisablesCertificateValidationConfig implements DataFlow
8080
predicate isSink(DataFlow::Node sink) {
8181
sink = any(HttpClientRequest req).getCertificateValidationControllingValue()
8282
}
83+
84+
predicate observeDiffInformedIncrementalMode() {
85+
// TODO(diff-informed): Manually verify if config can be diff-informed.
86+
// lib/codeql/ruby/frameworks/http_clients/HttpClient.qll:67: Flow call outside 'select' clause
87+
none()
88+
}
8389
}
8490

8591
private module HttpClientDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/Httparty.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ private module HttpartyDisablesCertificateValidationConfig implements DataFlow::
7070
predicate isSink(DataFlow::Node sink) {
7171
sink = any(HttpartyRequest req).getCertificateValidationControllingValue()
7272
}
73+
74+
predicate observeDiffInformedIncrementalMode() {
75+
// TODO(diff-informed): Manually verify if config can be diff-informed.
76+
// lib/codeql/ruby/frameworks/http_clients/Httparty.qll:59: Flow call outside 'select' clause
77+
none()
78+
}
7379
}
7480

7581
private module HttpartyDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/NetHttp.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ private module NetHttpDisablesCertificateValidationConfig implements DataFlow::C
103103
predicate isSink(DataFlow::Node sink) {
104104
sink = any(NetHttpRequest req).getCertificateValidationControllingValue()
105105
}
106+
107+
predicate observeDiffInformedIncrementalMode() {
108+
// TODO(diff-informed): Manually verify if config can be diff-informed.
109+
// lib/codeql/ruby/frameworks/http_clients/NetHttp.qll:90: Flow call outside 'select' clause
110+
none()
111+
}
106112
}
107113

108114
private module NetHttpDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/OpenURI.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ private module OpenUriDisablesCertificateValidationConfig implements DataFlow::C
110110
or
111111
sink = any(OpenUriKernelOpenRequest req).getCertificateValidationControllingValue()
112112
}
113+
114+
predicate observeDiffInformedIncrementalMode() {
115+
// TODO(diff-informed): Manually verify if config can be diff-informed.
116+
// lib/codeql/ruby/frameworks/http_clients/OpenURI.qll:48: Flow call outside 'select' clause
117+
// lib/codeql/ruby/frameworks/http_clients/OpenURI.qll:95: Flow call outside 'select' clause
118+
none()
119+
}
113120
}
114121

115122
private module OpenUriDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/RestClient.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ private module RestClientDisablesCertificateValidationConfig implements DataFlow
7373
predicate isSink(DataFlow::Node sink) {
7474
sink = any(RestClientHttpRequest req).getCertificateValidationControllingValue()
7575
}
76+
77+
predicate observeDiffInformedIncrementalMode() {
78+
// TODO(diff-informed): Manually verify if config can be diff-informed.
79+
// lib/codeql/ruby/frameworks/http_clients/RestClient.qll:60: Flow call outside 'select' clause
80+
none()
81+
}
7682
}
7783

7884
private module RestClientDisablesCertificateValidationFlow =

ruby/ql/lib/codeql/ruby/frameworks/http_clients/Typhoeus.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ private module TyphoeusDisablesCertificateValidationConfig implements DataFlow::
6464
predicate isSink(DataFlow::Node sink) {
6565
sink = any(TyphoeusHttpRequest req).getCertificateValidationControllingValue()
6666
}
67+
68+
predicate observeDiffInformedIncrementalMode() {
69+
// TODO(diff-informed): Manually verify if config can be diff-informed.
70+
// lib/codeql/ruby/frameworks/http_clients/Typhoeus.qll:53: Flow call outside 'select' clause
71+
none()
72+
}
6773
}
6874

6975
private module TyphoeusDisablesCertificateValidationFlow =

0 commit comments

Comments
 (0)