Class TaintWrapperSet

java.lang.Object
soot.jimple.infoflow.taintWrappers.TaintWrapperSet
All Implemented Interfaces:
IReversibleTaintWrapper, ITaintPropagationWrapper

public class TaintWrapperSet extends Object implements IReversibleTaintWrapper
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 Details

    • TaintWrapperSet

      public TaintWrapperSet()
  • Method Details

    • initialize

      public void initialize(InfoflowManager manager)
      Description copied from interface: ITaintPropagationWrapper
      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. Note that this method is guaranteed to be called only once and only by a single thread.
      Specified by:
      initialize in interface ITaintPropagationWrapper
      Parameters:
      manager - The manager object providing access to the data flow solver processing the IFDS edges and the interprocedural control flow graph
    • getPreAnalysisHandlers

      public Collection<PreAnalysisHandler> getPreAnalysisHandlers()
      Description copied from interface: ITaintPropagationWrapper
      This method returns a PreAnalysisHandler that runs before the InfoflowManager creation. Use this method, for example, to inject hierarchy information.
      Specified by:
      getPreAnalysisHandlers in interface ITaintPropagationWrapper
      Returns:
      a collection of PreAnalysisHandlers. Assumed to be non-null.
    • addWrapper

      public void addWrapper(ITaintPropagationWrapper wrapper)
      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: ITaintPropagationWrapper
      Checks 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:
      getTaintsForMethod in interface ITaintPropagationWrapper
      Parameters:
      stmt - The invocation statement which to check for black-box taint propagation
      d1 - The abstraction at the beginning of the method that calls the wrapped method
      taintedPath - The tainted field or value to propagate
      Returns:
      The list of tainted values after the invocation statement referenced in Stmt has been executed
    • isExclusive

      public boolean isExclusive(soot.jimple.Stmt stmt, Abstraction taintedPath)
      Description copied from interface: ITaintPropagationWrapper
      Gets 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:
      isExclusive in interface ITaintPropagationWrapper
      Parameters:
      stmt - The call statement to check
      taintedPath - 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: ITaintPropagationWrapper
      Checks 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:
      supportsCallee in interface ITaintPropagationWrapper
      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: ITaintPropagationWrapper
      Checks 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:
      supportsCallee in interface ITaintPropagationWrapper
      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: ITaintPropagationWrapper
      Gets 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:
      getWrapperHits in interface ITaintPropagationWrapper
      Returns:
      The number of method model requests that succeeded
    • getWrapperMisses

      public int getWrapperMisses()
      Description copied from interface: ITaintPropagationWrapper
      Gets 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:
      getWrapperMisses in interface ITaintPropagationWrapper
      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: ITaintPropagationWrapper
      Gets the aliases that a summarized method generates for the given abstraction. Note that this is a may-alias problem.
      Specified by:
      getAliasesForMethod in interface ITaintPropagationWrapper
      Parameters:
      stmt - The statement that calls the summarized method
      d1 - The abstraction at the entry point of the method that calls the wrapped method
      taintedPath - 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: IReversibleTaintWrapper
      Checks 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 of getTaintsForMethod. 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:
      getInverseTaintsForMethod in interface IReversibleTaintWrapper
      Parameters:
      stmt - The invocation statement which to check for black-box taint propagation
      d1 - The abstraction at the beginning of the method that calls the wrapped method
      taintedPath - 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 Stmt has been executed