How to fix: Python Requirements File Exposed
A requirements.txt, Pipfile, or Pipfile.lock was found at a public URL. Python dependency files reveal the exact package versions installed, enabling attackers to find known CVEs in your dependencies.
Why it matters
Pinned dependency versions in requirements.txt allow attackers to cross-reference against public CVE databases to find exploitable vulnerabilities in your installed packages.
Dependency manifests should be development-only artifacts. Production web servers should never serve these files. They're commonly exposed when deploying directly from a repository or when static file serving is too permissive.
How to fix it
- 1Deny access to requirements.txt, Pipfile, Pipfile.lock, setup.py, and pyproject.toml in your web server config.
- 2Ensure your deployment process copies only the necessary application files, not the entire repository.
- 3Add these files to your web application's security headers or path-based access controls.
Code examples
Nginx deny rule
location ~* /(requirements\.txt|Pipfile(\.lock)?|setup\.py|pyproject\.toml|Gemfile(\.lock)?) {
deny all;
return 404;
}References
Detected automatically by VulnRadar. The check id is supply-chain-requirements-exposed, stable across every scan so you can filter or diff on it.
More supply chain checks
- Mediumnpm/yarn Lock 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
- MediumCDN Script With No Version Pin and No Integrity Hash
Questions
- How severe is Python Requirements File Exposed?
- VulnRadar rates this medium 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-requirements-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Python Requirements File Exposed map to?
- It maps to CWE-200. 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.