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(
6262
6363cached
6464private module Cached {
65+ private import codeql.ruby.dataflow.FlowSteps as FlowSteps
66+
6567 cached
6668 predicate forceCachingInSameStage ( ) { any ( ) }
6769
@@ -99,6 +101,8 @@ private module Cached {
99101 or
100102 FlowSummaryImpl:: Private:: Steps:: summaryLocalStep ( nodeFrom , nodeTo , false )
101103 or
104+ any ( FlowSteps:: AdditionalTaintStep s ) .step ( nodeFrom , nodeTo )
105+ or
102106 // Although flow through collections is modeled precisely using stores/reads, we still
103107 // allow flow out of a _tainted_ collection. This is needed in order to support taint-
104108 // tracking configurations where the source is a collection.
You can’t perform that action at this time.
0 commit comments