File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
ruby/ql/lib/codeql/ruby/dataflow Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Provides classes representing various flow steps for taint tracking.
3
+ */
4
+
5
+ private import codeql.ruby.DataFlow
6
+ private import internal.DataFlowPrivate as DFPrivate
7
+
8
+ private class Unit = DFPrivate:: Unit ;
9
+
10
+ /**
11
+ * A module importing the frameworks that implement additional flow steps,
12
+ * ensuring that they are visible to the taint tracking library.
13
+ */
14
+ private module Frameworks { }
15
+
16
+ /**
17
+ * A unit class for adding additional taint steps.
18
+ *
19
+ * Extend this class to add additional taint steps that should apply to all
20
+ * taint configurations.
21
+ */
22
+ class AdditionalTaintStep extends Unit {
23
+ /**
24
+ * Holds if the step from `node1` to `node2` should be considered a taint
25
+ * step for all configurations.
26
+ */
27
+ abstract predicate step ( DataFlow:: Node node1 , DataFlow:: Node node2 ) ;
28
+ }
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ private CfgNodes::ExprNodes::VariableWriteAccessCfgNode variablesInPattern(
62
62
63
63
cached
64
64
private module Cached {
65
+ private import codeql.ruby.dataflow.FlowSteps as FlowSteps
66
+
65
67
cached
66
68
predicate forceCachingInSameStage ( ) { any ( ) }
67
69
@@ -99,6 +101,8 @@ private module Cached {
99
101
or
100
102
FlowSummaryImpl:: Private:: Steps:: summaryLocalStep ( nodeFrom , nodeTo , false )
101
103
or
104
+ any ( FlowSteps:: AdditionalTaintStep s ) .step ( nodeFrom , nodeTo )
105
+ or
102
106
// Although flow through collections is modeled precisely using stores/reads, we still
103
107
// allow flow out of a _tainted_ collection. This is needed in order to support taint-
104
108
// tracking configurations where the source is a collection.
You can’t perform that action at this time.
0 commit comments