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
- 1Exclude Pipfile and Pipfile.lock from whatever is copied into the served directory.
- 2Add a web-server deny rule for dependency manifests as a backstop.
- 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
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 /appAudit the locked set
pipenv requirements | pip-audit -r /dev/stdinReferences
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.
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 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.