Class PotentialValueTracker

  • All Implemented Interfaces:
    TaintFrameAdditionalVisitor, edu.umd.cs.findbugs.Detector, edu.umd.cs.findbugs.Priorities

    public class PotentialValueTracker
    extends BasicInjectionDetector
    implements TaintFrameAdditionalVisitor
    This class detect potential default value and set it to the Taint instance. For example in props.getProperties("password","admin1234"), the second parameter (admin1234) is the default value if the property is not set. This detector doesn't report bugs like the other detector it only enhances the taint analysis. Being a detector, the behavior can be deactivated easily.
    • Constructor Detail

      • PotentialValueTracker

        public PotentialValueTracker​(edu.umd.cs.findbugs.BugReporter bugReporter)
    • Method Detail

      • visitInvoke

        public void visitInvoke​(org.apache.bcel.generic.InvokeInstruction invoke,
                                org.apache.bcel.generic.MethodGen methodGen,
                                TaintFrame frameType,
                                List<Taint> parameters,
                                org.apache.bcel.generic.ConstantPoolGen cpg)
                         throws edu.umd.cs.findbugs.ba.DataflowAnalysisException
        Description copied from interface: TaintFrameAdditionalVisitor
        This method will be triggered for every method invocation (static, interface, special and virtual). The constant pool allowed the resolution of method name, field name, constant strings, etc. The taintframe
        Specified by:
        visitInvoke in interface TaintFrameAdditionalVisitor
        methodGen - Method
        frameType - Frame representation after the invoke (results)
        parameters - Stack representation just before the invoke
        Throws:
        edu.umd.cs.findbugs.ba.DataflowAnalysisException
      • visitLoad

        public void visitLoad​(org.apache.bcel.generic.LoadInstruction load,
                              org.apache.bcel.generic.MethodGen methodGen,
                              TaintFrame frameType,
                              int numProduced,
                              org.apache.bcel.generic.ConstantPoolGen cpg)
        Specified by:
        visitLoad in interface TaintFrameAdditionalVisitor
      • visitReturn

        public void visitReturn​(org.apache.bcel.generic.MethodGen methodGen,
                                Taint returnValue,
                                org.apache.bcel.generic.ConstantPoolGen cpg)
                         throws Exception
        Specified by:
        visitReturn in interface TaintFrameAdditionalVisitor
        Parameters:
        methodGen - Method
        returnValue - State of the returned value.
        Throws:
        Exception