Skip to content

Commit a9af135

Browse files
committed
Python: Remove getALocalTaintSource
and `taintFlowsTo` for now..
1 parent b3ff3f7 commit a9af135

File tree

5 files changed

+0
-31
lines changed

5 files changed

+0
-31
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
lgtm,codescanning
22
* The class ParameterNode now extends LocalSourceNode, thus making methods like flowsTo available.
3-
* Local taint tracking can now be performed using the `taintFlowsTo` method on the `LocalSourceNode` class. Conversely, the new member predicate `getALocalTaintSource` can be called on a `DataFlow::Node` to obtain a `LocalSourceNode` from which taint can be tracked locally to that data-flow node.
43
* The new predicate `parameterNode` can now be used to map from a `Parameter` to a data-flow node.

python/ql/src/semmle/python/dataflow/new/internal/DataFlowPublic.qll

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,6 @@ class Node extends TNode {
139139
* Gets a local source node from which data may flow to this node in zero or more local data-flow steps.
140140
*/
141141
LocalSourceNode getALocalSource() { result.flowsTo(this) }
142-
143-
/**
144-
* Gets a local source node from which data may flow to this node in zero or more local taint-flow steps.
145-
*/
146-
LocalSourceNode getALocalTaintSource() { result.taintFlowsTo(this) }
147142
}
148143

149144
/** A data-flow node corresponding to an SSA variable. */

python/ql/src/semmle/python/dataflow/new/internal/LocalSources.qll

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import python
1010
import DataFlowPublic
1111
private import DataFlowPrivate
12-
private import TaintTrackingPublic
1312

1413
/**
1514
* A data flow node that is a source of local flow. This includes things like
@@ -28,10 +27,6 @@ class LocalSourceNode extends Node {
2827
pragma[inline]
2928
predicate flowsTo(Node nodeTo) { Cached::hasLocalSource(nodeTo, this) }
3029

31-
/** Holds if this `LocalSourceNode` can flow to `nodeTo` in one or more local taint steps. */
32-
pragma[inline]
33-
predicate taintFlowsTo(Node nodeTo) { Cached::hasLocalTaintSource(nodeTo, this) }
34-
3530
/**
3631
* Gets a reference (read or write) of attribute `attrName` on this node.
3732
*/
@@ -82,24 +77,6 @@ private module Cached {
8277
)
8378
}
8479

85-
/**
86-
* Holds if `source` is a `LocalSourceNode` that can reach `sink` via local taint steps.
87-
*
88-
* The slightly backwards parametering ordering is to force correct indexing.
89-
*/
90-
cached
91-
predicate hasLocalTaintSource(Node sink, Node source) {
92-
// Declaring `source` to be a `LocalSourceNode` currently causes a redundant check in the
93-
// recursive case, so instead we check it explicitly here.
94-
source = sink and
95-
source instanceof LocalSourceNode
96-
or
97-
exists(Node mid |
98-
hasLocalTaintSource(mid, source) and
99-
localTaintStep(mid, sink)
100-
)
101-
}
102-
10380
/**
10481
* Holds if `base` flows to the base of `ref` and `ref` has attribute name `attr`.
10582
*/

python/ql/test/2/library-tests/locations/general/Locations.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
| Dict | 46 | 54 | 46 | 55 |
5656
| Dict | 48 | 9 | 48 | 19 |
5757
| DictUnpacking | 46 | 52 | 46 | 55 |
58-
| DjangoViewClassHelper | 4 | 1 | 4 | 8 |
5958
| Ellipsis | 7 | 7 | 7 | 9 |
6059
| Ellipsis | 50 | 14 | 50 | 16 |
6160
| ExceptStmt | 32 | 9 | 32 | 31 |

python/ql/test/3/library-tests/locations/general/Locations.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
| Dict | 46 | 54 | 46 | 55 |
4545
| Dict | 48 | 9 | 48 | 19 |
4646
| DictUnpacking | 46 | 52 | 46 | 55 |
47-
| DjangoViewClassHelper | 4 | 1 | 4 | 8 |
4847
| Ellipsis | 7 | 7 | 7 | 9 |
4948
| Ellipsis | 50 | 14 | 50 | 16 |
5049
| ExceptStmt | 32 | 9 | 32 | 31 |

0 commit comments

Comments
 (0)