Skip to content

Commit 24916f8

Browse files
committed
rename runsImmediately to runsArbitraryCode
1 parent 3dd89bb commit 24916f8

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

ruby/ql/lib/codeql/ruby/Concepts.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ class CodeExecution extends DataFlow::Node instanceof CodeExecution::Range {
702702
/** Gets the argument that specifies the code to be executed. */
703703
DataFlow::Node getCode() { result = super.getCode() }
704704

705-
/** Holds if this execution immediately runs the input as code, as opposed to loading some code using the input as a "path". */
706-
predicate runsImmediately() { super.runsImmediately() }
705+
/** Holds if this execution runs arbitary code, as opposed to some restricted subset. E.g. `Object.send` will only run any method on an object. */
706+
predicate runsArbitraryCode() { super.runsArbitraryCode() }
707707
}
708708

709709
/** Provides a class for modeling new dynamic code execution APIs. */
@@ -718,8 +718,8 @@ module CodeExecution {
718718
/** Gets the argument that specifies the code to be executed. */
719719
abstract DataFlow::Node getCode();
720720

721-
/** Holds if this execution immediately runs the input as code, as opposed to loading some code using the input as a "path". */
722-
predicate runsImmediately() { any() }
721+
/** Holds if this execution runs arbitary code, as opposed to some restricted subset. E.g. `Object.send` will only run any method on an object. */
722+
predicate runsArbitraryCode() { any() }
723723
}
724724
}
725725

ruby/ql/lib/codeql/ruby/frameworks/ActiveJob.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module ActiveJob {
2626

2727
override DataFlow::Node getCode() { result = this.getArgument(0) }
2828

29-
override predicate runsImmediately() { none() }
29+
override predicate runsArbitraryCode() { none() }
3030
}
3131
}
3232
}

ruby/ql/lib/codeql/ruby/frameworks/ActiveStorage.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,6 @@ module ActiveStorage {
222222

223223
override DataFlow::Node getCode() { result = this.getArgument(0) }
224224

225-
override predicate runsImmediately() { none() }
225+
override predicate runsArbitraryCode() { none() }
226226
}
227227
}

ruby/ql/lib/codeql/ruby/frameworks/ActiveSupport.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module ActiveSupport {
3636

3737
override DataFlow::Node getCode() { result = this.getReceiver() }
3838

39-
override predicate runsImmediately() { none() }
39+
override predicate runsArbitraryCode() { none() }
4040
}
4141

4242
/**

ruby/ql/lib/codeql/ruby/frameworks/core/Kernel.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module Kernel {
167167

168168
override DataFlow::Node getCode() { result = this.getArgument(0) }
169169

170-
override predicate runsImmediately() { none() }
170+
override predicate runsArbitraryCode() { none() }
171171
}
172172

173173
private class TapSummary extends SimpleSummarizedCallable {

ruby/ql/lib/codeql/ruby/frameworks/core/Module.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ module Module {
4343

4444
override DataFlow::Node getCode() { result = this.getArgument(0) }
4545

46-
override predicate runsImmediately() { none() }
46+
override predicate runsArbitraryCode() { none() }
4747
}
4848
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module CodeInjection {
6969

7070
/** Gets a flow state for which this is a sink. */
7171
override DataFlow::FlowState getAFlowState() {
72-
if c.runsImmediately()
72+
if c.runsArbitraryCode()
7373
then result = [FlowState::substring(), FlowState::full()] // If it runs immediately, then it's always vulnerable.
7474
else result = FlowState::full() // If it "just" loads something, then it's only vulnerable if the attacker controls the entire string.
7575
}

0 commit comments

Comments
 (0)