Class AbstractTaintWrapper

java.lang.Object
soot.jimple.infoflow.taintWrappers.AbstractTaintWrapper
All Implemented Interfaces:
ITaintPropagationWrapper
Direct Known Subclasses:
EasyTaintWrapper, IdentityTaintWrapper, RecordingTaintWrapper

public abstract class AbstractTaintWrapper extends Object implements ITaintPropagationWrapper
Abstract base class for all taint propagation wrappers
Author:
Steven Arzt
  • Field Details

    • manager

      protected InfoflowManager manager
      Data flow manager that gives access to internal solver objects
  • Constructor Details

    • AbstractTaintWrapper

      public AbstractTaintWrapper()
  • 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.
    • isExclusiveInternal

      protected abstract boolean isExclusiveInternal(soot.jimple.Stmt stmt, AccessPath 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. In effect, this tells the analysis not to propagate inside the callee.
      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.
    • getTaintsForMethodInternal

      public abstract Set<AccessPath> getTaintsForMethodInternal(soot.jimple.Stmt stmt, AccessPath taintedPath)
      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.
      Parameters:
      stmt - The invocation statement which to check for black-box taint propagation
      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.
    • 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
    • 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