public class TaintMethodConfig extends Object implements TaintTypeConfig
SinksLoader| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
configPattern |
protected static Pattern |
fullMethodPattern |
static TaintMethodConfig |
SAFE_CONFIG |
| Constructor and Description |
|---|
TaintMethodConfig(boolean isConfigured)
Constructs an empty summary
|
TaintMethodConfig(TaintMethodConfig config)
Creates a copy of the summary (output taint not copied)
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accepts(String typeSignature,
String config) |
void |
addMutableStackIndex(int mutableStackIndex)
Adds a stack index modified by method
|
static TaintMethodConfig |
getDefaultConstructorConfig(int stackSize)
Constructs a default constructor summary
(modifies 2 stack items with UNKNOWN taint state)
|
Collection<Integer> |
getMutableStackIndices()
Returns all stack indices modified by method if there are any
|
Taint |
getOutputTaint()
Returns the output taint of the method describing the taint transfer
|
boolean |
hasMutableStackIndices()
Checks if there are any indices modified by method
|
boolean |
isConfigured()
Checks if the summary is configured or derived
|
boolean |
isInformative()
Checks if the summary needs to be saved or has no information value
|
TaintMethodConfig |
load(String taintConfig)
Loads method summary from String.
|
void |
setOuputTaint(Taint taint)
Sets the output taint of the method describing the taint transfer,
copy of the parameter is made and variable index is invalidated
|
String |
toString() |
public static final TaintMethodConfig SAFE_CONFIG
protected static final Pattern fullMethodPattern
protected static final Pattern configPattern
public TaintMethodConfig(boolean isConfigured)
isConfigured - true for configured summaries, false for derivedpublic TaintMethodConfig(TaintMethodConfig config)
config - Original taint config to copypublic Collection<Integer> getMutableStackIndices()
IllegalStateException - if there are not indices setpublic boolean hasMutableStackIndices()
public void addMutableStackIndex(int mutableStackIndex)
mutableStackIndex - index to addIllegalArgumentException - if index is negativepublic Taint getOutputTaint()
public void setOuputTaint(Taint taint)
taint - output taint to setpublic static TaintMethodConfig getDefaultConstructorConfig(int stackSize)
stackSize - size of the parameter stack (including instance)IllegalArgumentException - for stackSize < 1public boolean isInformative()
public boolean isConfigured()
public TaintMethodConfig load(String taintConfig) throws IOException
resultTaintState |resultTaintTags #stackMutationIndexes, where resultTaintState are stack indexes or Taint.State enums separated by comma, e.g. 1,2 or TAINTEDresultTaintTags are Taint.Tag enums separated by comma, started with plus or minus sign, e.g. +CR_ENCODED,-XSS_SAFEstackMutationIndexes are stack indexes separated by comma, e.g. 3,4org/owasp/esapi/Encoder.encodeForHTML(Ljava/lang/String;)Ljava/lang/String;:0|+XSS_SAFE,+CR_ENCODED,+LF_ENCODED0|+XSS_SAFE,+CR_ENCODED,+LF_ENCODEDXSS_SAFE, CR_ENCODED and CR_ENCODED tags setorg/owasp/esapi/Encoder.decodeForHTML(Ljava/lang/String;)Ljava/lang/String;:0|-XSS_SAFE,-CR_ENCODED,-LF_ENCODEDXSS_SAFE, CR_ENCODED and CR_ENCODED tagsjava/lang/StringBuilder.(Ljava/lang/String;)V:0#1,2
java/lang/StringBuilder.append(Ljava/lang/String;)Ljava/lang/StringBuilder;:0,1#1
method(Ljava/lang/String;D) is 2, not 1 as one would expectload in interface TaintTypeConfigtaintConfig - (state or parameter indices to merge separated by comma)#mutable positionIOException - for bad format of parameterNullPointerException - if argument is nullCopyright © 2017. All rights reserved.