Class BasicInjectionDetector

    • Constructor Detail

      • BasicInjectionDetector

        protected BasicInjectionDetector​(edu.umd.cs.findbugs.BugReporter bugReporter)
    • Method Detail

      • getInjectionPoint

        protected InjectionPoint getInjectionPoint​(org.apache.bcel.generic.InvokeInstruction invoke,
                                                   org.apache.bcel.generic.ConstantPoolGen cpg,
                                                   org.apache.bcel.generic.InstructionHandle handle)
        Specified by:
        getInjectionPoint in class AbstractInjectionDetector
      • loadConfiguredSinks

        protected void loadConfiguredSinks​(String filename,
                                           String bugType)
        Loads taint sinks from configuration
        Parameters:
        filename - name of the configuration file
        bugType - type of an injection bug
      • loadCustomSinksConfigFiles

        protected void loadCustomSinksConfigFiles()
        Loads taint sinks from custom file. The file name is passed using system property based on the current class name.

        Example for Linux/Mac OS X:
        • -Dfindsecbugs.injection.customconfigfile.SqlInjectionDetector="/tmp/sql-custom.txt|SQL_INJECTION_HIBERNATE:/tmp/sql2-custom.txt|SQL_INJECTION_HIBERNATE"
        • -Dfindsecbugs.injection.customconfigfile.ScriptInjectionDetector="/tmp/script-engine-custom.txt|SCRIPT_ENGINE_INJECTION:/tmp/el-custom.txt|EL_INJECTION"
        Example for Windows:
        • -Dfindsecbugs.injection.customconfigfile.SqlInjectionDetector="C:\Temp\sql-custom.txt|SQL_INJECTION_HIBERNATE;C:\Temp\sql2-custom.txt|SQL_INJECTION_HIBERNATE"
        • -Dfindsecbugs.injection.customconfigfile.ScriptInjectionDetector="C:\Temp\script-engine-custom.txt|SCRIPT_ENGINE_INJECTION;C:\Temp\el-custom.txt|EL_INJECTION"
      • loadCustomSinks

        protected void loadCustomSinks​(String fileName,
                                       String bugType)
        Loads taint sinks configuration file from file system. If the file doesn't exist on file system, loads the file from classpath.
        Parameters:
        fileName - name of the configuration file
        bugType - type of an injection bug
      • loadSink

        protected void loadSink​(String line,
                                String bugType)
        Loads a single taint sink (like a line of configuration)
        Parameters:
        line - specification of the sink
        bugType - type of an injection bug
      • addParsedInjectionPoint

        protected void addParsedInjectionPoint​(String fullMethodName,
                                               InjectionPoint injectionPoint)