public abstract class AbstractInjectionDetector extends AbstractTaintDetector
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Set<InjectionSink>> |
injectionSinks |
bugReporter| Modifier | Constructor and Description |
|---|---|
protected |
AbstractInjectionDetector(edu.umd.cs.findbugs.BugReporter bugReporter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
analyzeLocation(edu.umd.cs.findbugs.ba.ClassContext classContext,
org.apache.bcel.classfile.Method method,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.InvokeInstruction invoke,
TaintFrame fact,
String currentMethod) |
protected abstract InjectionPoint |
getInjectionPoint(org.apache.bcel.generic.InvokeInstruction invoke,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.InstructionHandle handle) |
protected int |
getPriority(Taint taint)
The default implementation of
getPriority() can be overridden if the severity and the confidence for risk
is particular. |
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 |
report()
Once the analysis is completed, all the collected sinks are reported as bugs.
|
analyzeMethod, shouldAnalyzeClass, visitClassContextprotected final Map<String,Set<InjectionSink>> injectionSinks
protected AbstractInjectionDetector(edu.umd.cs.findbugs.BugReporter bugReporter)
public void report()
report in interface edu.umd.cs.findbugs.Detectorreport in class AbstractTaintDetectorprotected void analyzeLocation(edu.umd.cs.findbugs.ba.ClassContext classContext,
org.apache.bcel.classfile.Method method,
org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.InvokeInstruction invoke,
TaintFrame fact,
String currentMethod)
throws edu.umd.cs.findbugs.ba.DataflowAnalysisException
analyzeLocation in class AbstractTaintDetectoredu.umd.cs.findbugs.ba.DataflowAnalysisExceptionprotected int getPriorityFromTaintFrame(TaintFrame fact, int offset) throws edu.umd.cs.findbugs.ba.DataflowAnalysisException
getPriorityFromTaintFrame() 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.fact - 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 int getPriority(Taint taint)
getPriority() can be overridden if the severity and the confidence for risk
is particular.
By default, injection will be rated "High" if the complete link between source and sink is made.
If it is not the case but concatenation with external source is made, "Medium" is used.taint - Detail about the state of the value passed (Cumulative information leading to the variable passed).protected abstract InjectionPoint getInjectionPoint(org.apache.bcel.generic.InvokeInstruction invoke, org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.InstructionHandle handle)
Copyright © 2017. All rights reserved.