Class TaintWrapperSet
java.lang.Object
soot.jimple.infoflow.taintWrappers.TaintWrapperSet
- All Implemented Interfaces:
IReversibleTaintWrapper,ITaintPropagationWrapper
Set of taint wrappers. It supports taint wrapping for a class if at least one
of the contained wrappers supports it. The resulting taints are the union of
all taints produced by the contained wrappers.
- Author:
- Steven Arzt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWrapper(ITaintPropagationWrapper wrapper) Adds the given wrapper to the chain of wrappers.getAliasesForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Gets the aliases that a summarized method generates for the given abstraction.getInverseTaintsForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Checks an invocation statement for black-box taint propagation.This method returns a PreAnalysisHandler that runs before the InfoflowManager creation.getTaintsForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Checks an invocation statement for black-box taint propagation.intGets the number of times in which the taint wrapper was able to exclusively model a method call.intGets the number of times in which the taint wrapper was NOT able to exclusively model a method call.voidinitialize(InfoflowManager manager) This method is called before the taint propagation is started to give the taint wrapper the chance to initialize required components once Soot is running, but before it is queried for the first time.booleanisExclusive(soot.jimple.Stmt stmt, Abstraction taintedPath) Gets whether the taints produced by this taint wrapper are exclusive, i.e. there are no other taints than those produced by the wrapper.booleansupportsCallee(soot.jimple.Stmt callSite) Checks whether this taint wrapper can in general produce artificial taints for the given call site.booleansupportsCallee(soot.SootMethod method) Checks whether this taint wrapper can in general produce artificial taints for the given callee.
-
Constructor Details
-
TaintWrapperSet
public TaintWrapperSet()
-
-
Method Details
-
initialize
Description copied from interface:ITaintPropagationWrapperThis method is called before the taint propagation is started to give the taint wrapper the chance to initialize required components once Soot is running, but before it is queried for the first time. Note that this method is guaranteed to be called only once and only by a single thread.- Specified by:
initializein interfaceITaintPropagationWrapper- Parameters:
manager- The manager object providing access to the data flow solver processing the IFDS edges and the interprocedural control flow graph
-
getPreAnalysisHandlers
Description copied from interface:ITaintPropagationWrapperThis method returns a PreAnalysisHandler that runs before the InfoflowManager creation. Use this method, for example, to inject hierarchy information.- Specified by:
getPreAnalysisHandlersin interfaceITaintPropagationWrapper- Returns:
- a collection of PreAnalysisHandlers. Assumed to be non-null.
-
addWrapper
Adds the given wrapper to the chain of wrappers.- Parameters:
wrapper- The wrapper to add to the chain.
-
getTaintsForMethod
public Set<Abstraction> getTaintsForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Description copied from interface:ITaintPropagationWrapperChecks an invocation statement for black-box taint propagation. This allows the wrapper to artificially propagate taints over method invocations without requiring the analysis to look inside the method.- Specified by:
getTaintsForMethodin interfaceITaintPropagationWrapper- Parameters:
stmt- The invocation statement which to check for black-box taint propagationd1- The abstraction at the beginning of the method that calls the wrapped methodtaintedPath- The tainted field or value to propagate- Returns:
- The list of tainted values after the invocation statement referenced in
Stmthas been executed
-
isExclusive
Description copied from interface:ITaintPropagationWrapperGets whether the taints produced by this taint wrapper are exclusive, i.e. there are no other taints than those produced by the wrapper. In effect, this tells the analysis not to propagate inside the callee.- Specified by:
isExclusivein interfaceITaintPropagationWrapper- Parameters:
stmt- The call statement to checktaintedPath- The tainted field or value to propagate- Returns:
- True if this taint wrapper is exclusive, otherwise false.
-
supportsCallee
public boolean supportsCallee(soot.SootMethod method) Description copied from interface:ITaintPropagationWrapperChecks whether this taint wrapper can in general produce artificial taints for the given callee. If an implementation returns "false" for a callee, all call sites for this callee might be removed if not needed elsewhere.- Specified by:
supportsCalleein interfaceITaintPropagationWrapper- Parameters:
method- The method to check- Returns:
- True if this taint wrapper can in general produce taints for the given method.
-
supportsCallee
public boolean supportsCallee(soot.jimple.Stmt callSite) Description copied from interface:ITaintPropagationWrapperChecks whether this taint wrapper can in general produce artificial taints for the given call site. If an implementation returns "false" for a call site, this call sites might be removed if not needed elsewhere.- Specified by:
supportsCalleein interfaceITaintPropagationWrapper- Parameters:
callSite- The call site to check- Returns:
- True if this taint wrapper can in general produce taints for the given call site.
-
getWrapperHits
public int getWrapperHits()Description copied from interface:ITaintPropagationWrapperGets the number of times in which the taint wrapper was able to exclusively model a method call. This is equal to the number of times isExclusive() returned true.- Specified by:
getWrapperHitsin interfaceITaintPropagationWrapper- Returns:
- The number of method model requests that succeeded
-
getWrapperMisses
public int getWrapperMisses()Description copied from interface:ITaintPropagationWrapperGets the number of times in which the taint wrapper was NOT able to exclusively model a method call. This is equal to the number of times isExclusive() returned false.- Specified by:
getWrapperMissesin interfaceITaintPropagationWrapper- Returns:
- The number of method model requests that failed
-
getAliasesForMethod
public Set<Abstraction> getAliasesForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Description copied from interface:ITaintPropagationWrapperGets the aliases that a summarized method generates for the given abstraction. Note that this is a may-alias problem.- Specified by:
getAliasesForMethodin interfaceITaintPropagationWrapper- Parameters:
stmt- The statement that calls the summarized methodd1- The abstraction at the entry point of the method that calls the wrapped methodtaintedPath- The abstraction for which the aliases shall be computed- Returns:
- The set of aliases for the given abstraction or null if no such aliases exist
-
getInverseTaintsForMethod
public Set<Abstraction> getInverseTaintsForMethod(soot.jimple.Stmt stmt, Abstraction d1, Abstraction taintedPath) Description copied from interface:IReversibleTaintWrapperChecks an invocation statement for black-box taint propagation. This allows the wrapper to artificially propagate taints over method invocations without requiring the analysis to look inside the method. Note that this method is the inverse ofgetTaintsForMethod. It obtains the taints that could have been tainted before a certain statement was executed given a taint that was active after the call.- Specified by:
getInverseTaintsForMethodin interfaceIReversibleTaintWrapper- Parameters:
stmt- The invocation statement which to check for black-box taint propagationd1- The abstraction at the beginning of the method that calls the wrapped methodtaintedPath- The tainted field or value to propagate. Note that this taint must be valid after the execution of the black-box method.- Returns:
- The list of possibly tainted values before the invocation statement
referenced in
Stmthas been executed
-