Skip to content

Commit d383c0f

Browse files
committed
Java: Remove temporary store-as-taint.
1 parent 65ac8be commit d383c0f

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

java/ql/src/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -127,92 +127,6 @@ predicate defaultImplicitTaintRead(DataFlow::Node node, DataFlow::Content c) {
127127
)
128128
}
129129

130-
/**
131-
* These configurations add a number of configuration-dependent additional taint
132-
* steps to all taint configurations. For each sink or additional step provided
133-
* by a given configuration the types are inspected to find those implicit
134-
* collection or array read steps that might be required at the sink or step
135-
* input. The corresponding store steps are then added as additional taint steps
136-
* to provide backwards-compatible taint flow to such sinks and steps.
137-
*
138-
* This is a temporary measure until support is added for such sinks that
139-
* require implicit read steps.
140-
*/
141-
private module StoreTaintSteps {
142-
private import semmle.code.java.dataflow.TaintTracking
143-
private import semmle.code.java.dataflow.TaintTracking2
144-
145-
private class StoreTaintConfig extends TaintTracking::Configuration {
146-
StoreTaintConfig() { this instanceof TaintTracking::Configuration or none() }
147-
148-
override predicate isSource(DataFlow::Node n) { none() }
149-
150-
override predicate isSink(DataFlow::Node n) { none() }
151-
152-
private predicate needsTaintStore(RefType container, Type elem, DataFlow::Content f) {
153-
exists(DataFlow::Node arg |
154-
(isSink(arg) or isAdditionalTaintStep(arg, _)) and
155-
(arg.asExpr() instanceof Argument or arg instanceof ArgumentNode) and
156-
arg.getType() = container
157-
or
158-
needsTaintStore(_, container, _)
159-
|
160-
container.(Array).getComponentType() = elem and
161-
f instanceof DataFlow::ArrayContent
162-
or
163-
container.(CollectionType).getElementType() = elem and
164-
f instanceof DataFlow::CollectionContent
165-
or
166-
container.(MapType).getValueType() = elem and
167-
f instanceof DataFlow::MapValueContent
168-
)
169-
}
170-
171-
override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
172-
exists(DataFlow::Content f, Type elem |
173-
storeStep(node1, f, node2) and
174-
needsTaintStore(_, elem, f) and
175-
not exists(Type srctyp | srctyp = node1.getTypeBound() | not compatibleTypes(srctyp, elem))
176-
)
177-
}
178-
}
179-
180-
private class StoreTaintConfig2 extends TaintTracking2::Configuration {
181-
StoreTaintConfig2() { this instanceof TaintTracking2::Configuration or none() }
182-
183-
override predicate isSource(DataFlow::Node n) { none() }
184-
185-
override predicate isSink(DataFlow::Node n) { none() }
186-
187-
private predicate needsTaintStore(RefType container, Type elem, DataFlow::Content f) {
188-
exists(DataFlow::Node arg |
189-
(isSink(arg) or isAdditionalTaintStep(arg, _)) and
190-
(arg.asExpr() instanceof Argument or arg instanceof ArgumentNode) and
191-
arg.getType() = container
192-
or
193-
needsTaintStore(_, container, _)
194-
|
195-
container.(Array).getComponentType() = elem and
196-
f instanceof DataFlow::ArrayContent
197-
or
198-
container.(CollectionType).getElementType() = elem and
199-
f instanceof DataFlow::CollectionContent
200-
or
201-
container.(MapType).getValueType() = elem and
202-
f instanceof DataFlow::MapValueContent
203-
)
204-
}
205-
206-
override predicate isAdditionalTaintStep(DataFlow::Node node1, DataFlow::Node node2) {
207-
exists(DataFlow::Content f, Type elem |
208-
storeStep(node1, f, node2) and
209-
needsTaintStore(_, elem, f) and
210-
not exists(Type srctyp | srctyp = node1.getTypeBound() | not compatibleTypes(srctyp, elem))
211-
)
212-
}
213-
}
214-
}
215-
216130
/**
217131
* Holds if taint can flow in one local step from `src` to `sink` excluding
218132
* local data flow steps. That is, `src` and `sink` are likely to represent

0 commit comments

Comments
 (0)