Class DefaultSourceSinkManager

java.lang.Object
soot.jimple.infoflow.sourcesSinks.manager.DefaultSourceSinkManager
All Implemented Interfaces:
IReversibleSourceSinkManager, ISourceSinkManager

public class DefaultSourceSinkManager extends Object implements IReversibleSourceSinkManager
A ISourceSinkManager working on lists of source and sink methods
Author:
Steven Arzt, Tim Lange
  • Field Details

    • sourceDefs

      protected Collection<String> sourceDefs
    • sinkDefs

      protected Collection<String> sinkDefs
    • interfacesOf

      protected final com.google.common.cache.LoadingCache<soot.SootClass,Collection<soot.SootClass>> interfacesOf
  • Constructor Details

    • DefaultSourceSinkManager

      public DefaultSourceSinkManager(Collection<String> sources, Collection<String> sinks)
      Creates a new instance of the DefaultSourceSinkManager class
      Parameters:
      sources - The list of methods to be treated as sources
      sinks - The list of methods to be treated as sins
    • DefaultSourceSinkManager

      public DefaultSourceSinkManager(Collection<String> sources, Collection<String> sinks, Collection<String> parameterTaintMethods, Collection<String> returnTaintMethods)
      Creates a new instance of the DefaultSourceSinkManager class
      Parameters:
      sources - The list of methods to be treated as sources
      sinks - The list of methods to be treated as sinks
      parameterTaintMethods - The list of methods whose parameters shall be regarded as sources
      returnTaintMethods - The list of methods whose return values shall be regarded as sinks
    • DefaultSourceSinkManager

      public DefaultSourceSinkManager(ISourceSinkDefinitionProvider sourceSinkProvider)
      Creates a new instance of the DefaultSourceSinkManager class
      Parameters:
      sourceSinkProvider - The provider that defines source and sink methods
  • Method Details

    • setSources

      public void setSources(List<String> sources)
      Sets the list of methods to be treated as sources
      Parameters:
      sources - The list of methods to be treated as sources
    • setSinks

      public void setSinks(List<String> sinks)
      Sets the list of methods to be treated as sinks
      Parameters:
      sinks - The list of methods to be treated as sinks
    • isSourceMethod

      protected boolean isSourceMethod(InfoflowManager manager, soot.jimple.Stmt sCallSite)
      Checks whether the given call sites invokes a source method
      Parameters:
      manager - The manager object providing access to the configuration and the interprocedural control flow graph
      sCallSite - The call site to check
      Returns:
      True if the given call site invoked a source method, otherwise false
    • isInverseSourceMethod

      protected SootMethodAndClass isInverseSourceMethod(InfoflowManager manager, soot.jimple.Stmt sCallSite)
    • isSinkMethod

      protected SootMethodAndClass isSinkMethod(InfoflowManager manager, soot.jimple.Stmt sCallSite)
      Checks whether the given call sites invokes a sink method
      Parameters:
      manager - The manager object providing access to the configuration and the interprocedural control flow graph
      sCallSite - The call site to check
      Returns:
      The method that was discovered as a sink, or null if no sink could be found
    • isInverseSinkMethod

      protected boolean isInverseSinkMethod(InfoflowManager manager, soot.jimple.Stmt sCallSite)
    • getSourceInfo

      public SourceInfo getSourceInfo(soot.jimple.Stmt sCallSite, InfoflowManager manager)
      Description copied from interface: ISourceSinkManager
      Determines if a method called by the Stmt is a source method or not. If so, additional information is returned
      Specified by:
      getSourceInfo in interface ISourceSinkManager
      Parameters:
      sCallSite - a Stmt which should include an invokeExrp calling a method
      manager - The manager object for interacting with the solver
      Returns:
      A SourceInfo object containing additional information if this call is a source, otherwise null
    • getSinkInfo

      public SinkInfo getSinkInfo(soot.jimple.Stmt sCallSite, InfoflowManager manager, AccessPath ap)
      Description copied from interface: ISourceSinkManager
      Checks if the given access path at this statement will leak.
      Specified by:
      getSinkInfo in interface ISourceSinkManager
      Parameters:
      sCallSite - The call site to check
      manager - The manager object for interacting with the solver
      ap - The access path to check. Pass null to check whether the given statement can be a sink for any given access path.
      Returns:
      A SinkInfo object containing additional information if this call is a sink, otherwise null
    • getInverseSourceInfo

      public SinkInfo getInverseSourceInfo(soot.jimple.Stmt sCallSite, InfoflowManager manager, AccessPath ap)
      Description copied from interface: IReversibleSourceSinkManager
      Determines whether this is a source resulting in a leak for backwards search. Creating a SinkInfo using source signatures.
      Specified by:
      getInverseSourceInfo in interface IReversibleSourceSinkManager
      Parameters:
      sCallSite - a Stmt which should include an invokeExrp calling a method
      manager - The manager object for interacting with the solver
      ap - The access path to check. Pass null to check whether the given statement can be a sink for any given access path.
      Returns:
      A SourceInfo object containing additional information if this call is a source, otherwise null
    • getInverseSinkInfo

      public SourceInfo getInverseSinkInfo(soot.jimple.Stmt sCallSite, InfoflowManager manager)
      Description copied from interface: IReversibleSourceSinkManager
      Determines if a method called by the Stmt is a sink method or not. If so, additional information is returned to introduce a taint. Creating a SourceInfo using sink signatures
      Specified by:
      getInverseSinkInfo in interface IReversibleSourceSinkManager
      Parameters:
      sCallSite - The call site to check
      manager - The manager object for interacting with the solver
      Returns:
      A SinkInfo object containing additional information if this call is a sink, otherwise null
    • setParameterTaintMethods

      public void setParameterTaintMethods(List<String> parameterTaintMethods)
      Sets the list of methods whose parameters shall be regarded as taint sources
      Parameters:
      parameterTaintMethods - The list of methods whose parameters shall be regarded as taint sources
    • setReturnTaintMethods

      public void setReturnTaintMethods(List<String> returnTaintMethods)
      Sets the list of methods whose return values shall be regarded as taint sinks
      Parameters:
      returnTaintMethods - The list of methods whose return values shall be regarded as taint sinks
    • initialize

      public void initialize()
      Description copied from interface: ISourceSinkManager
      Initialization method that is called after the Soot instance has been created and before the actual data flow tracking is started.
      Specified by:
      initialize in interface ISourceSinkManager