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

How to fix: Python Pipfile.lock exposed

The response is a Pipenv lockfile, identified by its _meta block and pipfile-spec version.

Why it matters

Pipfile.lock resolves both the default and develop sections, so it discloses the production dependency set and the test, lint and debugging tooling in one document. Its _meta.sources block names every package index the build pulls from, which reveals a private index URL when one is configured.

Pipenv writes a hash for each artifact, which is a real integrity control and is the reason the file exists. That value is entirely on the install side; there is no reason for the file to be reachable over HTTP. It usually appears because a deployment copies the whole project directory into the served root rather than only the built application.

How to fix it

  1. 1Exclude Pipfile and Pipfile.lock from whatever is copied into the served directory.
  2. 2Add a web-server deny rule for dependency manifests as a backstop.
  3. 3Check the pinned versions against an advisory database now that the exact set is public.

Code examples

Keep manifests out of the image's served path

DOCKERFILE
FROM python:3.12-slim
WORKDIR /app
COPY Pipfile Pipfile.lock /tmp/
RUN cd /tmp && pipenv install --deploy --system && rm -f /tmp/Pipfile*
COPY ./app /app

Audit the locked set

bash
pipenv requirements | pip-audit -r /dev/stdin

References

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

See every supply chain check

Questions

How severe is Python Pipfile.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-pipfile-lock-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Python Pipfile.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 python pipfile.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: Python Pipfile.lock exposed | VulnRadar