Skip to main content
LowSupply chainOWASP A05:2021CWE-540

How to fix: Elixir mix.lock exposed

The response is an Elixir mix.lock file, identified by two or more Hex package tuples in its {:hex, :name, ...} form.

Why it matters

The lockfile enumerates every Hex package and its exact version, including the ones that define the web stack (Phoenix, Plug, Cowboy) and any dependency that ships native code. That is enough to identify a vulnerable Phoenix or Plug release without touching the application.

Elixir releases built with mix release do not include mix.lock, so a served copy almost always means the application is running from a source checkout under the document root. That is worth investigating on its own: the same directory usually contains config files, and Phoenix's config/runtime.exs is where secrets are read.

How to fix it

  1. 1Deploy a mix release rather than serving from a source checkout.
  2. 2Confirm Plug.Static is scoped with :only to the specific asset directories, not pointed at the project root.
  3. 3Check the config directory is not also reachable.

Code examples

Phoenix: scope static serving explicitly

ELIXIR
plug Plug.Static,
  at: "/",
  from: :my_app,
  gzip: true,
  only: MyAppWeb.static_paths()   # never `from: "."`

Audit the locked Hex packages

bash
mix deps.audit
# or
mix hex.audit

References

Detected automatically by VulnRadar. The check id is supply-chain-mix-lock-exposed, stable across every scan so you can filter or diff on it.

See every supply chain check

Questions

How severe is Elixir mix.lock exposed?
VulnRadar rates this low severity in the supply chain category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id supply-chain-mix-lock-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Elixir mix.lock exposed map to?
It maps to CWE-540. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for elixir mix.lock exposed

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Elixir mix.lock exposed | VulnRadar