class Arachni::Browser::Javascript::TaintTracer::Sink::DataFlow

Represents an intercepted JS call due to {#tainted_argument_value tainted} {Frame::CalledFunction#arguments}.

@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>

Attributes

function[RW]

@return [Frame::CalledFunction]

Relevant function.
object[RW]

@return [String]

Name of the object containing {#function}.
taint[RW]

@return [String]

Active taint.
tainted_argument_index[RW]

@return [Integer]

Index for the tainted argument in {Frame::CalledFunction#arguments}.
tainted_value[RW]

@return [Object]

Tainted value of {#tainted_argument_value}, located by traversing it
recursively.

Public Class Methods

from_rpc_data( data ) click to toggle source
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 72
def self.from_rpc_data( data )
    data['function'] = Frame::CalledFunction.from_rpc_data( data['function'] )
    super data
end
new( options = {} ) click to toggle source
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 42
def initialize( options = {} )
    if options[:function].is_a? Hash
        @function = Frame::CalledFunction.new( options.delete(:function) )
    end

    super
end

Public Instance Methods

tainted_argument_name() click to toggle source

@return [String, nil]

Name of the tainted argument.
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 59
def tainted_argument_name
    return if !function.signature_arguments
    function.signature_arguments[tainted_argument_index]
end
tainted_argument_value() click to toggle source

@return [String, nil]

Value of the tainted argument.
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 52
def tainted_argument_value
    return if !function.arguments
    function.arguments[tainted_argument_index]
end
to_h() click to toggle source
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 64
def to_h
    super.merge( function: function.to_h )
end
to_rpc_data() click to toggle source
# File lib/arachni/browser/javascript/taint_tracer/sink/data_flow.rb, line 68
def to_rpc_data
    to_h.merge( function: function.to_rpc_data )
end