public class HashUnsafeEqualsDetector extends BasicInjectionDetector implements TaintFrameAdditionalVisitor
Detect:
if(hashInput.equals(actualHash)) {
....
}
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
HASH_WORDS |
injectionSinksbugReporter| Constructor and Description |
|---|
HashUnsafeEqualsDetector(edu.umd.cs.findbugs.BugReporter bugReporter) |
| Modifier and Type | Method and Description |
|---|---|
protected InjectionPoint |
getInjectionPoint(org.apache.bcel.generic.InvokeInstruction invoke,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.InstructionHandle handle) |
protected int |
getPriorityFromTaintFrame(TaintFrame fact,
int offset)
The default implementation of
getPriorityFromTaintFrame() can be overridden if the detector must base its
priority on multiple parameters or special conditions like constant values. |
void |
visitField(org.apache.bcel.generic.FieldInstruction put,
org.apache.bcel.generic.MethodGen methodGen,
TaintFrame frameType,
Taint taint,
int numProduced,
org.apache.bcel.generic.ConstantPoolGen cpg) |
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)
This method will be triggered for every method invocation (static, interface, special and virtual).
|
void |
visitLoad(org.apache.bcel.generic.LoadInstruction instruction,
org.apache.bcel.generic.MethodGen methodGen,
TaintFrame frameType,
int numProduced,
org.apache.bcel.generic.ConstantPoolGen cpg) |
void |
visitReturn(org.apache.bcel.generic.MethodGen methodGen,
Taint returnValue,
org.apache.bcel.generic.ConstantPoolGen cpg) |
addParsedInjectionPoint, loadConfiguredSinks, loadConfiguredSinks, loadCustomSinks, loadCustomSinksConfigFiles, loadSink, registerVisitoranalyzeLocation, getPriority, reportanalyzeMethod, shouldAnalyzeClass, visitClassContextpublic HashUnsafeEqualsDetector(edu.umd.cs.findbugs.BugReporter bugReporter)
protected int getPriorityFromTaintFrame(TaintFrame fact, int offset) throws edu.umd.cs.findbugs.ba.DataflowAnalysisException
AbstractInjectionDetectorgetPriorityFromTaintFrame() can be overridden if the detector must base its
priority on multiple parameters or special conditions like constant values.
By default, this method will call the getPriority() method with the parameter taint at the specified offset.getPriorityFromTaintFrame in class AbstractInjectionDetectorfact - The TaintFrame for the inspected instruction call.offset - The offset of the checked parameter.edu.umd.cs.findbugs.ba.DataflowAnalysisException - An exception thrown when the TaintFrame cannot be analyzed.protected InjectionPoint getInjectionPoint(org.apache.bcel.generic.InvokeInstruction invoke, org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InstructionHandle handle)
getInjectionPoint in class BasicInjectionDetectorpublic 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)
TaintFrameAdditionalVisitorvisitInvoke in interface TaintFrameAdditionalVisitormethodGen - MethodframeType - Frame representation after the invoke (results)parameters - Stack representation just before the invokepublic void visitReturn(org.apache.bcel.generic.MethodGen methodGen,
Taint returnValue,
org.apache.bcel.generic.ConstantPoolGen cpg)
throws Exception
visitReturn in interface TaintFrameAdditionalVisitormethodGen - MethodreturnValue - State of the returned value.Exceptionpublic void visitLoad(org.apache.bcel.generic.LoadInstruction instruction,
org.apache.bcel.generic.MethodGen methodGen,
TaintFrame frameType,
int numProduced,
org.apache.bcel.generic.ConstantPoolGen cpg)
visitLoad in interface TaintFrameAdditionalVisitorpublic void visitField(org.apache.bcel.generic.FieldInstruction put,
org.apache.bcel.generic.MethodGen methodGen,
TaintFrame frameType,
Taint taint,
int numProduced,
org.apache.bcel.generic.ConstantPoolGen cpg)
throws Exception
visitField in interface TaintFrameAdditionalVisitorExceptionCopyright © 2019. All rights reserved.