# `VulnCheck`
[🔗](https://github.com/Voskan/vulncheck/blob/v1.0.1/lib/vulncheck.ex#L1)

Function-level reachability vulnerability scanner for Elixir, Erlang and Gleam.

VulnCheck matches locked dependencies against OSV.dev and EEF CNA CVE 5.1
advisories, then proves — on compiled `.beam` call graphs enriched with OTP
supervision roots, framework callbacks and runtime adapter configuration —
whether the vulnerable functions can actually execute in production.

# `explain`

```elixir
@spec explain(String.t(), keyword()) ::
  {:ok, VulnCheck.Explain.result()} | {:error, term()}
```

Describes an advisory (`CVE-...`, `EEF-CVE-...`, `GHSA-...`) and, when the
project directory locks the affected package, its local reachability
verdict and call trace.

Accepts the same options as `scan/2`, plus `:project_dir` (default `"."`)
or a `:config` struct.

    {:ok, %{advisories: [advisory | _], local: local}} =
      VulnCheck.explain("CVE-2026-101028", project_dir: "path/to/app")

# `scan`

```elixir
@spec scan(VulnCheck.Config.t() | Path.t(), keyword()) ::
  {:ok, VulnCheck.Types.ScanReport.t()} | {:error, term()}
```

Scans a project.

Accepts a `VulnCheck.Config` or a project directory plus configuration
fields as keyword options (for example `env: :prod, offline: true`).
Feed options such as `:http_client` are passed to `VulnCheck.Scanner.run/2`.

    {:ok, report} = VulnCheck.scan("path/to/app", offline: true)

# `should_fail?`

```elixir
@spec should_fail?(VulnCheck.Types.ScanReport.t(), VulnCheck.Config.t()) :: boolean()
```

Returns `true` when the report must fail the build under `config`:

  * an active (not suppressed) finding with a verdict selected by
    `fail_on` and a severity of at least `min_severity`
    (unknown severities count as critical),
  * a retired release when `fail_on_retired` is set (production
    dependencies, or security retirements of others under `--fail-on any`),
  * a policy violation (for example a forbidden new suppression).

# `version`

```elixir
@spec version() :: String.t()
```

Returns the VulnCheck version.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
