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
- 1Deploy a mix release rather than serving from a source checkout.
- 2Confirm Plug.Static is scoped with :only to the specific asset directories, not pointed at the project root.
- 3Check the config directory is not also reachable.
Code examples
Phoenix: scope static serving explicitly
plug Plug.Static,
at: "/",
from: :my_app,
gzip: true,
only: MyAppWeb.static_paths() # never `from: "."`Audit the locked Hex packages
mix deps.audit
# or
mix hex.auditReferences
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.
More supply chain checks
- Mediumnpm/yarn Lock File Exposed
- MediumPython Requirements File Exposed
- MediumRuby Gemfile or Gemfile.lock Exposed
- MediumExternal CDN Script Without SRI Hash
- HighHTTP Script Loaded on HTTPS Page
- MediumPHP composer.json or composer.lock Exposed
- HighDockerfile or docker-compose.yml Exposed
- Critical.env File Exposed at Public URL
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.