A Module.function/arity reference stored entirely as strings.
Advisory feeds and third-party .beam files mention thousands of module and
function names. Converting them to atoms would let untrusted input exhaust the
BEAM atom table, so every symbol handled by the analyzer is kept as a canonical
string:
- Elixir modules keep their BEAM name, e.g.
"Elixir.Plug.Conn.Query". - Erlang modules keep their plain name, e.g.
"cow_http_hd".
Atoms that already exist (for example those read from compiled .beam chunks)
are converted with Atom.to_string/1, which never creates new atoms.
Summary
Functions
Orders two MFAs deterministically (module, function, arity).
Formats a canonical module name for display ("Plug.Conn" or ":cowlib").
Returns true when the canonical module name belongs to an Elixir module.
Formats an MFA for humans: Plug.Conn.Query.decode/4 or :cow_http_hd.parse/1.
Builds an MFA from a module (atom or string), function (atom or string) and arity.
Normalizes a module name to its canonical BEAM string.
Parses a routine string as published in EEF CNA programRoutines, GHSA
advisories or written by humans.
Converts an MFA to a {module, function, arity} tuple of strings.
Types
@type t() :: %VulnCheck.Types.MFA{ arity: non_neg_integer(), function: String.t(), module: String.t() }
Functions
Orders two MFAs deterministically (module, function, arity).
Formats a canonical module name for display ("Plug.Conn" or ":cowlib").
Returns true when the canonical module name belongs to an Elixir module.
Formats an MFA for humans: Plug.Conn.Query.decode/4 or :cow_http_hd.parse/1.
Builds an MFA from a module (atom or string), function (atom or string) and arity.
Normalizes a module name to its canonical BEAM string.
iex> VulnCheck.Types.MFA.normalize_module("Plug.Conn")
"Elixir.Plug.Conn"
iex> VulnCheck.Types.MFA.normalize_module("'cow_http_hd'")
"cow_http_hd"
iex> VulnCheck.Types.MFA.normalize_module(:"Elixir.Plug.Conn")
"Elixir.Plug.Conn"
Parses a routine string as published in EEF CNA programRoutines, GHSA
advisories or written by humans.
Supported notations:
'Elixir.Plug.Conn.Query':decode/4
hex_http_httpc:http_options/2
'cow_http_hd':parse/1
Ash.Actions.Aggregate.run/4
:cow_http_hd.parse/1Returns :error when the string has no explicit arity or is malformed.
No atoms are created.
iex> VulnCheck.Types.MFA.parse_routine("'Elixir.Plug.Conn.Query':decode/4")
{:ok, %VulnCheck.Types.MFA{module: "Elixir.Plug.Conn.Query", function: "decode", arity: 4}}
iex> VulnCheck.Types.MFA.parse_routine("Ash.read")
:error
@spec to_tuple(t()) :: {String.t(), String.t(), non_neg_integer()}
Converts an MFA to a {module, function, arity} tuple of strings.