VulnCheck.Solver.RoutineScope (VulnCheck v1.0.1)

Copy Markdown View Source

Splits the routines and modules named by an advisory into those that belong to the vulnerable package and context routines from elsewhere.

CVE records often list functions on the vulnerable path that live outside the package, such as List.delete/2 or a function of another dependency. Those are reachable in almost any project, so treating them as targets would prove nothing about the package. A module is part of the package when:

  • a compiled module of that name belongs to the package; or
  • no compiled module of that name exists and it is not a module of the Erlang/OTP or Elixir installation running the scan (unknown modules stay targets, so missing .beam files never hide an advisory).

Modules compiled for another package or the project, and platform modules, are context.

Summary

Functions

true when module ships with the Erlang/OTP or Elixir installation.

Returns the advisory restricted to the routines and modules of the package, and the context routines.

Splits advisory's routines and modules for the package known by the names in owners (lockfile key and OTP application), using the compiled modules of the workspace (%{module_name => ModuleSummary.t()}; may be empty).

Types

split()

@type split() :: %{
  routines: [VulnCheck.Types.MFA.t()],
  modules: [String.t()],
  context_routines: [VulnCheck.Types.MFA.t()]
}

Functions

platform_module?(module)

@spec platform_module?(String.t()) :: boolean()

true when module ships with the Erlang/OTP or Elixir installation.

scope(advisory, owners, modules)

Returns the advisory restricted to the routines and modules of the package, and the context routines.

split(advisory, owners, modules)

@spec split(VulnCheck.Types.Advisory.t(), [String.t()], %{
  required(String.t()) => VulnCheck.Types.ModuleSummary.t()
}) :: split()

Splits advisory's routines and modules for the package known by the names in owners (lockfile key and OTP application), using the compiled modules of the workspace (%{module_name => ModuleSummary.t()}; may be empty).