|
4 | 4 |
|
5 | 5 | import Member
|
6 | 6 | import semmle.code.java.security.ExternalProcess
|
7 |
| -private import semmle.code.java.dataflow.DataFlow |
8 | 7 | private import semmle.code.java.dataflow.FlowSteps
|
9 | 8 |
|
10 | 9 | // --- Standard types ---
|
@@ -203,48 +202,6 @@ class TypeFile extends Class {
|
203 | 202 | TypeFile() { this.hasQualifiedName("java.io", "File") }
|
204 | 203 | }
|
205 | 204 |
|
206 |
| -/** |
207 |
| - * A taint step from an update of the `bytes[]` parameter in an override of the `InputStream.read` method |
208 |
| - * to a class instance expression of the type extending `InputStream`. |
209 |
| - * |
210 |
| - * This models how a subtype of `InputStream` could be tainted by the definition of its methods, which will |
211 |
| - * normally only happen in anonymous classes. |
212 |
| - */ |
213 |
| -private class InputStreamWrapperAnonymousStep extends AdditionalTaintStep { |
214 |
| - override predicate step(DataFlow::Node n1, DataFlow::Node n2) { |
215 |
| - exists(Method m, AnonymousClass wrapper | |
216 |
| - m.hasName("read") and |
217 |
| - m.getDeclaringType() = wrapper and |
218 |
| - wrapper.getASourceSupertype+() instanceof TypeInputStream |
219 |
| - | |
220 |
| - n1.(DataFlow::PostUpdateNode).getPreUpdateNode().asExpr() = m.getParameter(0).getAnAccess() and |
221 |
| - n2.asExpr() = wrapper.getClassInstanceExpr() |
222 |
| - ) |
223 |
| - } |
224 |
| -} |
225 |
| - |
226 |
| -/** |
227 |
| - * A taint step from an `InputStream` argument of the constructor of an `InputStream` subtype |
228 |
| - * to the call of the constructor, only if the argument is assigned to a class field. |
229 |
| - * |
230 |
| - * This models how it's assumed that an `InputStream` wrapper is tainted by the wrapped stream, |
231 |
| - * and is a workaround to low `fieldFlowBranchLimit`s in dataflow configurations. |
232 |
| - */ |
233 |
| -private class InputStreamWrapperConstructorStep extends AdditionalTaintStep { |
234 |
| - override predicate step(DataFlow::Node n1, DataFlow::Node n2) { |
235 |
| - exists(ClassInstanceExpr cc, Argument a, AssignExpr ae, int pos | |
236 |
| - cc.getConstructedType().getASourceSupertype+() instanceof TypeInputStream and |
237 |
| - cc.getArgument(pragma[only_bind_into](pos)) = a and |
238 |
| - cc.getCallee().getParameter(pragma[only_bind_into](pos)).getAnAccess() = ae.getRhs() and |
239 |
| - ae.getDest().(FieldWrite).getField().getType().(RefType).getASourceSupertype*() instanceof |
240 |
| - TypeInputStream |
241 |
| - | |
242 |
| - n1.asExpr() = a and |
243 |
| - n2.asExpr() = cc |
244 |
| - ) |
245 |
| - } |
246 |
| -} |
247 |
| - |
248 | 205 | // --- Standard methods ---
|
249 | 206 | /**
|
250 | 207 | * DEPRECATED: Any constructor of class `java.lang.ProcessBuilder`.
|
|
0 commit comments