Class PotentialValueTracker
- java.lang.Object
-
- com.h3xstream.findsecbugs.injection.AbstractTaintDetector
-
- com.h3xstream.findsecbugs.injection.AbstractInjectionDetector
-
- com.h3xstream.findsecbugs.injection.BasicInjectionDetector
-
- com.h3xstream.findsecbugs.taintanalysis.extra.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 inprops.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.
-
-
Field Summary
-
Fields inherited from class com.h3xstream.findsecbugs.injection.AbstractInjectionDetector
injectionSinks
-
Fields inherited from class com.h3xstream.findsecbugs.injection.AbstractTaintDetector
bugReporter
-
-
Constructor Summary
Constructors Constructor Description PotentialValueTracker(edu.umd.cs.findbugs.BugReporter bugReporter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvisitField(org.apache.bcel.generic.FieldInstruction put, org.apache.bcel.generic.MethodGen methodGen, TaintFrame frameType, Taint taintFrame, int numProduced, org.apache.bcel.generic.ConstantPoolGen cpg)voidvisitInvoke(org.apache.bcel.generic.InvokeInstruction invoke, org.apache.bcel.generic.MethodGen methodGen, TaintFrame frameType, List<Taint> parameters, org.apache.bcel.generic.ConstantPoolGen cpg)This method will be triggered for every method invocation (static, interface, special and virtual).voidvisitLoad(org.apache.bcel.generic.LoadInstruction load, org.apache.bcel.generic.MethodGen methodGen, TaintFrame frameType, int numProduced, org.apache.bcel.generic.ConstantPoolGen cpg)voidvisitReturn(org.apache.bcel.generic.MethodGen methodGen, Taint returnValue, org.apache.bcel.generic.ConstantPoolGen cpg)-
Methods inherited from class com.h3xstream.findsecbugs.injection.BasicInjectionDetector
addParsedInjectionPoint, getInjectionPoint, loadConfiguredSinks, loadConfiguredSinks, loadCustomSinks, loadCustomSinksConfigFiles, loadSink, registerVisitor
-
Methods inherited from class com.h3xstream.findsecbugs.injection.AbstractInjectionDetector
analyzeLocation, getPriority, getPriorityFromTaintFrame, report
-
Methods inherited from class com.h3xstream.findsecbugs.injection.AbstractTaintDetector
analyzeMethod, shouldAnalyzeClass, visitClassContext
-
-
-
-
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.DataflowAnalysisExceptionDescription copied from interface:TaintFrameAdditionalVisitorThis 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:
visitInvokein interfaceTaintFrameAdditionalVisitormethodGen- MethodframeType- 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:
visitLoadin interfaceTaintFrameAdditionalVisitor
-
visitField
public void visitField(org.apache.bcel.generic.FieldInstruction put, org.apache.bcel.generic.MethodGen methodGen, TaintFrame frameType, Taint taintFrame, int numProduced, org.apache.bcel.generic.ConstantPoolGen cpg) throws Exception- Specified by:
visitFieldin interfaceTaintFrameAdditionalVisitor- Throws:
Exception
-
visitReturn
public void visitReturn(org.apache.bcel.generic.MethodGen methodGen, Taint returnValue, org.apache.bcel.generic.ConstantPoolGen cpg) throws Exception- Specified by:
visitReturnin interfaceTaintFrameAdditionalVisitor- Parameters:
methodGen- MethodreturnValue- State of the returned value.- Throws:
Exception
-
-