Skip to content

Commit 0097e49

Browse files
authored
Merge pull request github#18337 from asgerf/rb/diff-informed
Ruby: enable diff-informed data flow queries
2 parents f319003 + 29b829b commit 0097e49

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

+126
-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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ private module ExconDisablesCertificateValidationConfig implements DataFlow::Con
118118
predicate isSink(DataFlow::Node sink) {
119119
sink = any(ExconHttpRequest req).getCertificateValidationControllingValue()
120120
}
121+
122+
predicate observeDiffInformedIncrementalMode() {
123+
none() // Used for a library model
124+
}
121125
}
122126

123127
private module ExconDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ 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+
none() // Used for a library model
105+
}
102106
}
103107

104108
private module FaradayDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ private module HttpClientDisablesCertificateValidationConfig implements DataFlow
8080
predicate isSink(DataFlow::Node sink) {
8181
sink = any(HttpClientRequest req).getCertificateValidationControllingValue()
8282
}
83+
84+
predicate observeDiffInformedIncrementalMode() {
85+
none() // Used for a library model
86+
}
8387
}
8488

8589
private module HttpClientDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ private module HttpartyDisablesCertificateValidationConfig implements DataFlow::
7070
predicate isSink(DataFlow::Node sink) {
7171
sink = any(HttpartyRequest req).getCertificateValidationControllingValue()
7272
}
73+
74+
predicate observeDiffInformedIncrementalMode() {
75+
none() // Used for a library model
76+
}
7377
}
7478

7579
private module HttpartyDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ private module NetHttpDisablesCertificateValidationConfig implements DataFlow::C
103103
predicate isSink(DataFlow::Node sink) {
104104
sink = any(NetHttpRequest req).getCertificateValidationControllingValue()
105105
}
106+
107+
predicate observeDiffInformedIncrementalMode() {
108+
none() // Used for a library model
109+
}
106110
}
107111

108112
private module NetHttpDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ private module OpenUriDisablesCertificateValidationConfig implements DataFlow::C
110110
or
111111
sink = any(OpenUriKernelOpenRequest req).getCertificateValidationControllingValue()
112112
}
113+
114+
predicate observeDiffInformedIncrementalMode() {
115+
none() // Used for a library model
116+
}
113117
}
114118

115119
private module OpenUriDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ private module RestClientDisablesCertificateValidationConfig implements DataFlow
7373
predicate isSink(DataFlow::Node sink) {
7474
sink = any(RestClientHttpRequest req).getCertificateValidationControllingValue()
7575
}
76+
77+
predicate observeDiffInformedIncrementalMode() {
78+
none() // Used for a library model
79+
}
7680
}
7781

7882
private module RestClientDisablesCertificateValidationFlow =

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ private module TyphoeusDisablesCertificateValidationConfig implements DataFlow::
6464
predicate isSink(DataFlow::Node sink) {
6565
sink = any(TyphoeusHttpRequest req).getCertificateValidationControllingValue()
6666
}
67+
68+
predicate observeDiffInformedIncrementalMode() {
69+
none() // Used for a library model
70+
}
6771
}
6872

6973
private module TyphoeusDisablesCertificateValidationFlow =

0 commit comments

Comments
 (0)