Skip to content

Commit 8c99ad4

Browse files
committed
Ruby: Remove deprecated configuration classes referencing deleted api.
1 parent 8a5fc97 commit 8c99ad4

30 files changed

+0
-683
lines changed

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

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,6 @@ private import codeql.ruby.TaintTracking
99
private import codeql.ruby.ApiGraphs
1010
import UnicodeBypassValidationCustomizations::UnicodeBypassValidation
1111

12-
/**
13-
* A state signifying that a logical validation has not been performed.
14-
* DEPRECATED: Use `PreValidationState()`
15-
*/
16-
deprecated class PreValidation extends DataFlow::FlowState {
17-
PreValidation() { this = "PreValidation" }
18-
}
19-
20-
/**
21-
* A state signifying that a logical validation has been performed.
22-
* DEPRECATED: Use `PostValidationState()`
23-
*/
24-
deprecated class PostValidation extends DataFlow::FlowState {
25-
PostValidation() { this = "PostValidation" }
26-
}
27-
2812
/**
2913
* A state signifying if a logical validation has been performed or not.
3014
*/
@@ -34,40 +18,6 @@ private newtype ValidationState =
3418
// A state signifying that a logical validation has been performed.
3519
PostValidationState()
3620

37-
/**
38-
* A taint-tracking configuration for detecting "Unicode transformation mishandling" vulnerabilities.
39-
*
40-
* This configuration uses two flow states, `PreValidation` and `PostValidation`,
41-
* to track the requirement that a logical validation has been performed before the Unicode Transformation.
42-
* DEPRECATED: Use `UnicodeBypassValidationFlow`
43-
*/
44-
deprecated class Configuration extends TaintTracking::Configuration {
45-
Configuration() { this = "UnicodeBypassValidation" }
46-
47-
private ValidationState convertState(DataFlow::FlowState state) {
48-
state instanceof PreValidation and result = PreValidationState()
49-
or
50-
state instanceof PostValidation and result = PostValidationState()
51-
}
52-
53-
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) {
54-
UnicodeBypassValidationConfig::isSource(source, this.convertState(state))
55-
}
56-
57-
override predicate isAdditionalTaintStep(
58-
DataFlow::Node nodeFrom, DataFlow::FlowState stateFrom, DataFlow::Node nodeTo,
59-
DataFlow::FlowState stateTo
60-
) {
61-
UnicodeBypassValidationConfig::isAdditionalFlowStep(nodeFrom, this.convertState(stateFrom),
62-
nodeTo, this.convertState(stateTo))
63-
}
64-
65-
/* A Unicode Tranformation (Unicode tranformation) is considered a sink when the algorithm used is either NFC or NFKC. */
66-
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) {
67-
UnicodeBypassValidationConfig::isSink(sink, this.convertState(state))
68-
}
69-
}
70-
7121
/**
7222
* A taint-tracking configuration for detecting "Unicode transformation mishandling" vulnerabilities.
7323
*

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,6 @@ private import codeql.ruby.DataFlow
99
private import codeql.ruby.TaintTracking
1010
private import codeql.ruby.ApiGraphs
1111

12-
/**
13-
* A taint-tracking configuration for reasoning about zip slip
14-
* vulnerabilities.
15-
* DEPRECATED: Use `ZipSlipFlow`
16-
*/
17-
deprecated class Configuration extends TaintTracking::Configuration {
18-
Configuration() { this = "ZipSlip" }
19-
20-
override predicate isSource(DataFlow::Node source) { source instanceof ZipSlip::Source }
21-
22-
override predicate isSink(DataFlow::Node sink) { sink instanceof ZipSlip::Sink }
23-
24-
/**
25-
* This should actually be
26-
* `and cn = API::getTopLevelMember("Gem").getMember("Package").getMember("TarReader").getMember("Entry").getAMethodCall("full_name")` and similar for other classes
27-
* but I couldn't make it work so there's only check for the method name called on the entry. It is `full_name` for `Gem::Package::TarReader::Entry` and `Zlib`
28-
* and `name` for `Zip::File`
29-
*/
30-
override predicate isAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
31-
exists(DataFlow::CallNode cn |
32-
cn.getReceiver() = nodeFrom and
33-
cn.getMethodName() in ["full_name", "name"] and
34-
cn = nodeTo
35-
)
36-
}
37-
38-
override predicate isSanitizer(DataFlow::Node node) { node instanceof ZipSlip::Sanitizer }
39-
}
40-
4112
private module ZipSlipConfig implements DataFlow::ConfigSig {
4213
predicate isSource(DataFlow::Node source) { source instanceof ZipSlip::Source }
4314

ruby/ql/lib/codeql/ruby/security/CleartextLoggingQuery.qll

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,6 @@ private import codeql.ruby.TaintTracking
1212
import CleartextLoggingCustomizations::CleartextLogging
1313
private import CleartextLoggingCustomizations::CleartextLogging as CL
1414

15-
/**
16-
* A taint-tracking configuration for detecting "Clear-text logging of sensitive information".
17-
* DEPRECATED: Use `CleartextLoggingFlow` instead
18-
*/
19-
deprecated class Configuration extends TaintTracking::Configuration {
20-
Configuration() { this = "CleartextLogging" }
21-
22-
override predicate isSource(DataFlow::Node source) { source instanceof CL::Source }
23-
24-
override predicate isSink(DataFlow::Node sink) { sink instanceof CL::Sink }
25-
26-
override predicate isSanitizer(DataFlow::Node node) {
27-
super.isSanitizer(node)
28-
or
29-
node instanceof CL::Sanitizer
30-
}
31-
32-
override predicate isAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
33-
CL::isAdditionalTaintStep(nodeFrom, nodeTo)
34-
}
35-
}
36-
3715
private module Config implements DataFlow::ConfigSig {
3816
predicate isSource(DataFlow::Node source) { source instanceof CL::Source }
3917

ruby/ql/lib/codeql/ruby/security/CleartextStorageQuery.qll

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,6 @@ private import codeql.ruby.DataFlow
1111
private import codeql.ruby.TaintTracking
1212
private import CleartextStorageCustomizations::CleartextStorage as CS
1313

14-
/**
15-
* A taint-tracking configuration for detecting "Clear-text storage of sensitive information".
16-
* DEPRECATED: Use `CleartextStorageFlow` instead
17-
*/
18-
deprecated class Configuration extends TaintTracking::Configuration {
19-
Configuration() { this = "CleartextStorage" }
20-
21-
override predicate isSource(DataFlow::Node source) { source instanceof CS::Source }
22-
23-
override predicate isSink(DataFlow::Node sink) { sink instanceof CS::Sink }
24-
25-
override predicate isSanitizer(DataFlow::Node node) {
26-
super.isSanitizer(node)
27-
or
28-
node instanceof CS::Sanitizer
29-
}
30-
31-
override predicate isAdditionalTaintStep(DataFlow::Node nodeFrom, DataFlow::Node nodeTo) {
32-
CS::isAdditionalTaintStep(nodeFrom, nodeTo)
33-
}
34-
}
35-
3614
private module Config implements DataFlow::ConfigSig {
3715
predicate isSource(DataFlow::Node source) { source instanceof CS::Source }
3816

ruby/ql/lib/codeql/ruby/security/CodeInjectionCustomizations.qll

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ private import codeql.ruby.frameworks.data.internal.ApiGraphModels
1414
module CodeInjection {
1515
/** Flow states used to distinguish whether an attacker controls the entire string. */
1616
module FlowState {
17-
/**
18-
* Flow state used for normal tainted data, where an attacker might only control a substring.
19-
* DEPRECATED: Use `SubString()`
20-
*/
21-
deprecated DataFlow::FlowState substring() { result = "substring" }
22-
23-
/**
24-
* Flow state used for data that is entirely controlled by the attacker.
25-
* DEPRECATED: Use `Full()`
26-
*/
27-
deprecated DataFlow::FlowState full() { result = "full" }
28-
2917
private newtype TState =
3018
TFull() or
3119
TSubString()
@@ -62,14 +50,6 @@ module CodeInjection {
6250
* A data flow source for "Code injection" vulnerabilities.
6351
*/
6452
abstract class Source extends DataFlow::Node {
65-
/**
66-
* Gets a flow state for which this is a source.
67-
* DEPRECATED: Use `getAState()`
68-
*/
69-
deprecated DataFlow::FlowState getAFlowState() {
70-
result = [FlowState::substring(), FlowState::full()]
71-
}
72-
7353
/** Gets a flow state for which this is a source. */
7454
FlowState::State getAState() {
7555
result instanceof FlowState::SubString or result instanceof FlowState::Full
@@ -80,14 +60,6 @@ module CodeInjection {
8060
* A data flow sink for "Code injection" vulnerabilities.
8161
*/
8262
abstract class Sink extends DataFlow::Node {
83-
/**
84-
* Holds if this sink is safe for an attacker that only controls a substring.
85-
* DEPRECATED: Use `getAState()`
86-
*/
87-
deprecated DataFlow::FlowState getAFlowState() {
88-
result = [FlowState::substring(), FlowState::full()]
89-
}
90-
9163
/** Holds if this sink is safe for an attacker that only controls a substring. */
9264
FlowState::State getAState() { any() }
9365
}
@@ -96,13 +68,6 @@ module CodeInjection {
9668
* A sanitizer for "Code injection" vulnerabilities.
9769
*/
9870
abstract class Sanitizer extends DataFlow::Node {
99-
/**
100-
* Gets a flow state for which this is a sanitizer.
101-
* Sanitizes all states if the result is empty.
102-
* DEPRECATED: Use `getAState()`
103-
*/
104-
deprecated DataFlow::FlowState getAFlowState() { none() }
105-
10671
/**
10772
* Gets a flow state for which this is a sanitizer.
10873
* Sanitizes all states if the result is empty.
@@ -123,12 +88,6 @@ module CodeInjection {
12388

12489
CodeExecutionAsSink() { this = c.getCode() }
12590

126-
deprecated override DataFlow::FlowState getAFlowState() {
127-
if c.runsArbitraryCode()
128-
then result = [FlowState::substring(), FlowState::full()] // If it runs arbitrary code then it's always vulnerable.
129-
else result = FlowState::full() // If it "just" loads something, then it's only vulnerable if the attacker controls the entire string.
130-
}
131-
13291
override FlowState::State getAState() {
13392
if c.runsArbitraryCode()
13493
then any() // If it runs arbitrary code then it's always vulnerable.
@@ -153,8 +112,6 @@ module CodeInjection {
153112
)
154113
}
155114

156-
deprecated override DataFlow::FlowState getAFlowState() { result = FlowState::full() }
157-
158115
override FlowState::State getAState() { result instanceof FlowState::Full }
159116
}
160117

ruby/ql/lib/codeql/ruby/security/CodeInjectionQuery.qll

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,6 @@ import codeql.ruby.TaintTracking
1111
import CodeInjectionCustomizations::CodeInjection
1212
import codeql.ruby.dataflow.BarrierGuards
1313

14-
/**
15-
* A taint-tracking configuration for detecting "Code injection" vulnerabilities.
16-
* DEPRECATED: Use `CodeInjectionFlow` instead
17-
*/
18-
deprecated class Configuration extends TaintTracking::Configuration {
19-
Configuration() { this = "CodeInjection" }
20-
21-
override predicate isSource(DataFlow::Node source, DataFlow::FlowState state) {
22-
state = source.(Source).getAFlowState()
23-
}
24-
25-
override predicate isSink(DataFlow::Node sink, DataFlow::FlowState state) {
26-
state = sink.(Sink).getAFlowState()
27-
}
28-
29-
override predicate isSanitizer(DataFlow::Node node) {
30-
node instanceof Sanitizer and not exists(node.(Sanitizer).getAFlowState())
31-
or
32-
node instanceof StringConstCompareBarrier
33-
or
34-
node instanceof StringConstArrayInclusionCallBarrier
35-
}
36-
37-
override predicate isSanitizer(DataFlow::Node node, DataFlow::FlowState state) {
38-
node.(Sanitizer).getAFlowState() = state
39-
}
40-
}
41-
4214
private module Config implements DataFlow::StateConfigSig {
4315
class FlowState = FlowState::State;
4416

ruby/ql/lib/codeql/ruby/security/CommandInjectionQuery.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,6 @@ import CommandInjectionCustomizations::CommandInjection
1313
import codeql.ruby.DataFlow
1414
import codeql.ruby.dataflow.BarrierGuards
1515

16-
/**
17-
* A taint-tracking configuration for reasoning about command-injection vulnerabilities.
18-
* DEPRECATED: Use `CommandInjectionFlow` instead
19-
*/
20-
deprecated class Configuration extends TaintTracking::Configuration {
21-
Configuration() { this = "CommandInjection" }
22-
23-
override predicate isSource(DataFlow::Node source) { source instanceof Source }
24-
25-
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
26-
27-
override predicate isSanitizer(DataFlow::Node node) {
28-
node instanceof Sanitizer or
29-
node instanceof StringConstCompareBarrier or
30-
node instanceof StringConstArrayInclusionCallBarrier
31-
}
32-
}
33-
3416
private module Config implements DataFlow::ConfigSig {
3517
predicate isSource(DataFlow::Node source) { source instanceof Source }
3618

ruby/ql/lib/codeql/ruby/security/ConditionalBypassQuery.qll

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,6 @@ private import codeql.ruby.TaintTracking
1111
private import codeql.ruby.security.SensitiveActions
1212
import ConditionalBypassCustomizations::ConditionalBypass
1313

14-
/**
15-
* A taint tracking configuration for bypass of sensitive action guards.
16-
* DEPRECATED: Use `ConditionalBypassFlow` instead
17-
*/
18-
deprecated class Configuration extends TaintTracking::Configuration {
19-
Configuration() { this = "ConditionalBypass" }
20-
21-
override predicate isSource(DataFlow::Node source) { source instanceof Source }
22-
23-
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
24-
25-
override predicate isSanitizer(DataFlow::Node node) {
26-
super.isSanitizer(node) or
27-
node instanceof Sanitizer
28-
}
29-
}
30-
3114
private module Config implements DataFlow::ConfigSig {
3215
predicate isSource(DataFlow::Node source) { source instanceof Source }
3316

ruby/ql/lib/codeql/ruby/security/HardcodedDataInterpretedAsCodeCustomizations.qll

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ module HardcodedDataInterpretedAsCode {
1919
* Flow states used to distinguish value-preserving flow from taint flow.
2020
*/
2121
module FlowState {
22-
/**
23-
* Flow state used to track value-preserving flow.
24-
* DEPRECATED: Use `Data()`
25-
*/
26-
deprecated DataFlow::FlowState data() { result = "data" }
27-
28-
/**
29-
* Flow state used to tainted data (non-value preserving flow).
30-
* DEPRECATED: Use `Taint()`
31-
*/
32-
deprecated DataFlow::FlowState taint() { result = "taint" }
33-
3422
/**
3523
* Flow states used to distinguish value-preserving flow from taint flow.
3624
*/
@@ -45,12 +33,6 @@ module HardcodedDataInterpretedAsCode {
4533
* A data flow source for hard-coded data.
4634
*/
4735
abstract class Source extends DataFlow::Node {
48-
/**
49-
* Gets a flow label for which this is a source.
50-
* DEPRECATED: Use `getALabel()`
51-
*/
52-
deprecated DataFlow::FlowState getLabel() { result = FlowState::data() }
53-
5436
/**
5537
* Gets a flow label for which this is a source.
5638
*/
@@ -64,17 +46,6 @@ module HardcodedDataInterpretedAsCode {
6446
/** Gets a description of what kind of sink this is. */
6547
abstract string getKind();
6648

67-
/**
68-
* Gets a flow label for which this is a sink.
69-
* DEPRECATED: Use `getALabel()`
70-
*/
71-
deprecated DataFlow::FlowState getLabel() {
72-
// We want to ignore value-flow and only consider taint-flow, since the
73-
// source is just a hex string, and evaluating that directly will just
74-
// cause a syntax error.
75-
result = FlowState::taint()
76-
}
77-
7849
/**
7950
* Gets a flow label for which this is a sink.
8051
*/

0 commit comments

Comments
 (0)