Class TaintConfig

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<String,​TaintMethodConfig>

    public class TaintConfig
    extends HashMap<String,​TaintMethodConfig>
    Map of taint summaries for all known methods and classes This class extends HashMap:
    • The key is the method signature (ie : org/hibernate/Session.createQuery(Ljava/lang/String;)Lorg/hibernate/Query;)
    • The value is the behavior of the method ("0" for param index 0 is tainted, "UNKNOWN" if the method does not become tainted base on the value, "TAINTED" if the result must be consider unsafe)
    Author:
    David Formanek (Y Soft Corporation, a.s.)
    See Also:
    Serialized Form
    • Constructor Detail

      • TaintConfig

        public TaintConfig()
    • Method Detail

      • dump

        public void dump​(PrintStream output)
        Dumps all the summaries for debugging
        Parameters:
        output - stream where to output the summaries
      • load

        public void load​(InputStream input,
                         boolean checkRewrite)
                  throws IOException
        Loads summaries from stream checking the format
        Parameters:
        input - input stream of configured summaries
        checkRewrite - whether to check duplicit summaries
        Throws:
        IOException - if cannot read the stream or the format is bad
        IllegalArgumentException - for bad method format
        IllegalStateException - if there are duplicit configurations
      • isClassImmutable

        public boolean isClassImmutable​(String typeSignature)
      • isClassTaintSafe

        public boolean isClassTaintSafe​(String typeSignature)
      • getStaticFieldTaint

        public Taint getStaticFieldTaint​(String fieldSignature,
                                         Taint defaultValue)
      • putStaticFieldTaint

        public void putStaticFieldTaint​(String fieldSignature,
                                        Taint t)