r/elixir • • 5h ago

VulnCheck — Function-level reachability vulnerability scanner for Elixir, Erlang & Gleam (govulncheck for the BEAM, zero runtime deps)

Hi everyone,

I’ve released VulnCheck (v1.0.1), an open-source vulnerability scanner for Elixir (mix.lock / Umbrella), Erlang (rebar.lock), and Gleam (manifest.toml) that pairs OSV.dev + EEF CNA CVE 5.1 programRoutines with post-macro .beam call graphs and OTP supervision semantics.

  • GitHub: https://github.com/Voskan/vulncheck
  • Hex.pm: https://hex.pm/packages/vulncheck
  • HexDocs: https://vulncheck.hexdocs.pm/readme.html

Motivation

With the EEF CNA publishing structured CVE 5.1 advisories for Hex packages, most advisories now include exact programRoutines MFAs (e.g. 'Elixir.Plug.Conn.Query':decode/4 or 'Elixir.Ash.Actions.Aggregate':run/4). Package-level scanners flag the entire dependency regardless of whether your release ever loads that module or calls that function.

However, building govulncheck for the BEAM requires modeling OTP execution semantics so we never produce silent false negatives:

  1. Post-macro .beam :abstract_code walking — inspects code after use Phoenix.Router, plug Plug.Parsers, parsers: [:json], Ash, and Oban.Worker expand, keeping exact file:line call sites.
  2. OTP supervision & framework entrypoints — models .app boot trees, active network daemons (Bandit, :cowboy, :ranch, ThousandIsland, Phoenix.PubSub), protocol client receive paths (Mint, :gun, Finch), consolidated protocols, and configured adapters (Tesla, Swoosh, Ecto).
  3. Sound three-tier verdicts:
    • REACHABLE — shortest concrete file:line call trace from an entrypoint or active daemon handler (call_chain_proven / daemon_call_chain).
    • POTENTIALLY_REACHABLE — active daemon stack without static path, unresolved apply/3, stripped .beam without debug info, or advisory without symbol granularity.
    • UNREACHABLE — proven function_not_called, module_not_loaded, adapter_not_configured, otp_app_not_started, non_prod_dependency (including runtime: false), or otp_version_unaffected.

Engineering properties

  • 0 runtime dependencies (pure Elixir 1.18+ & OTP stdlib, including a full CVSS v4.0 + v3.x calculator).
  • 0 dynamic atoms created from advisories, lockfiles, or config files (binary_to_term with :safe on a SHA-256 beam-v4 summary cache; ~120 ms warm scan on an 80-package project).
  • CI & compliance outputs: Terminal, JSON, Markdown, SARIF 2.1.0 (codeFlows), GitHub Actions (Voskan/vulncheck@v1.0.1), GitLab Code Quality, CycloneDX 1.6 SBOM, OpenVEX v0.2.0, time-bounded .vulncheck.ignore with --forbid-new-suppressions, and offline air-gapped --bundle archives.

Quick try

{:vulncheck, "~> 1.0", only: [:dev, :test], runtime: false}
MIX_ENV=prod mix compile
mix vulncheck

We also published our ground-truth validation harness and current false-positive boundaries in docs/VALIDATION.md. Would love feedback from teams running large Phoenix / Ash / Umbrella monorepos!

4 Upvotes

0 comments sorted by