Class TaintPath


  • public class TaintPath
    extends Object
    A single tainted data flow from a source to a sink, with the CPG nodes traversed and any sanitizers seen along the way.
    • Method Detail

      • getSource

        public TaintSource getSource()
        Returns:
        the source
      • getSink

        public TaintSink getSink()
        Returns:
        the sink
      • getSourceNode

        public CPGNode getSourceNode()
        Returns:
        the source node
      • getSinkNode

        public CPGNode getSinkNode()
        Returns:
        the sink node
      • getPath

        public List<CPGNode> getPath()
        Returns:
        the path
      • getSanitizers

        public Set<String> getSanitizers()
        Returns:
        the sanitizers
      • getPathLength

        public int getPathLength()
        Returns:
        the number of nodes on the path
      • isSanitized

        public boolean isSanitized()
        Returns:
        true if at least one sanitizer was recorded
      • addSanitizer

        public void addSanitizer​(String sanitizer)
        Records a sanitizer applied along this path.
        Parameters:
        sanitizer - name of the sanitizing routine
      • getVulnerabilityType

        public VulnerabilityType getVulnerabilityType()
        Returns:
        the vulnerability type reported by the sink
      • getSeverity

        public Severity getSeverity()
        Severity of the sink, downgraded to INFO once the path is sanitized.
        Returns:
        the effective severity
      • getSourceLocation

        public String getSourceLocation()
        Renders the source node position as "method:line", falling back to the node label.
        Returns:
        the formatted location, or "unknown" when there is no source node
      • getSinkLocation

        public String getSinkLocation()
        Renders the sink node position as "method:line", falling back to the node label.
        Returns:
        the formatted location, or "unknown" when there is no sink node
      • formatPath

        public String formatPath()
        Builds a multi-line report listing the source, every hop, the sink, and any sanitizers.
        Returns:
        the formatted report
      • toShortString

        public String toShortString()
        Builds a one-line summary of the flow, its severity, hop count, and sanitization state.
        Returns:
        the summary line
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object