Synthesizes the call edges that OTP and framework behaviours create at runtime and that never appear as direct calls in the bytecode.
- Starting a behaviour module (
start_link/*,child_spec/1,init/1,new/*for Oban workers,__live__/0for LiveViews) links all of its callbacks (:behaviour_callback). - A literal reference to a module (a supervisor child, a plug, a
registered GenServer name, a router target) links the referencing
function to that module's start functions and callbacks
(
:supervisor_child). apply(Mod, fun, args)with a known module and an unknown function links every exported function of matching arity as a candidate.- Protocol functions are linked to the matching
defimplfunctions. Plug.Parsersis linked only to the parsers configured statically (parsers: [:json]), or to every parser when the list is dynamic; parsers are linked to the callback modules of their options (body reader, JSON decoder).- Framework dispatch through a module held in a variable is linked to the implementations of the framework's behaviour: ThousandIsland transports, Mint connections and transports.
- The Tesla middleware stack (
Tesla.run/2) is linked to thecallfunctions of the modules named in reachable code or configuration.
Summary
Functions
Callback signatures ("name/arity") known for a behaviour.
Functions that a reference to module may run: start functions and
behaviour callbacks that the module defines.
Computes all synthetic edges for the loaded modules.
Types
@type result() :: %{ edges: [VulnCheck.Types.CallEdge.t()], resolved_dynamic_modules: %{required(String.t()) => [String.t()]}, resolved_dynamic_calls: MapSet.t(VulnCheck.Types.DynamicCall.t()), active_plug_parsers: [String.t()] | :all, state: term() }
Functions
Callback signatures ("name/arity") known for a behaviour.
@spec entry_functions(VulnCheck.Types.ModuleSummary.t()) :: [VulnCheck.Types.MFA.t()]
Functions that a reference to module may run: start functions and
behaviour callbacks that the module defines.
@spec synthesize(VulnCheck.Beam.CallGraph.t(), keyword()) :: result()
Computes all synthetic edges for the loaded modules.
Options:
:reachable(a set of functions, default:all) restricts thePlug.Parsersconfigurations and the module names that feed dynamic framework calls to those written in these functions;:configured_modules— modules named by the project configuration.