Exposed environment file (.env)
This file is being served to anyone who requests it, and it holds the credentials your application runs on — database URLs, API keys, and signing secrets.
Why it matters
This file is being served to anyone who requests it, and it holds the credentials your application runs on — database URLs, API keys, and signing secrets. Anyone who reads it can act as your backend: read and modify your data, spend against your paid API accounts, and sign tokens your app will trust. Assume every value in it is already compromised and rotate them, not just the file's visibility.
How ShipReady detects it
Exposed .env file detection. Deliberately its own check rather than one of disclosure.py's generic "debug endpoints": a served .env is not an information leak of the same order as a stray /admin route — it is the single file that holds every credential the application has. It was previously folded into `exposed-debug-endpoint` at medium severity / medium confidence, which badly understated it. Here it is critical, high-confidence, and confirmed by content shape rather than by status code alone. PRIVACY: this check reads a file full of live secrets. It therefore emits variable NAMES and a count only — never a value. `redact_evidence` is fail-closed, so even a future accidental value would be dropped before display, but the safer property is that values never enter the evidence dict in the first place.
Detection is deterministic. ShipReady reports this only when it observes the condition directly, and prefers to miss a real problem over inventing one. Rule version 1.0.0.
How to fix it
This is the prompt ShipReady puts in your report — written to be pasted straight into Cursor, Claude Code, or whichever assistant built the app.
Your .env file is publicly downloadable, exposing every credential it contains. Treat all of them as compromised: rotate each secret at its provider first, then stop serving the file — add .env* to .gitignore and your deploy ignore list, deploy only build output instead of the whole repository, and block requests to /.env* at your web server, host, or CDN. Verify by requesting the path again and confirming it returns 404.
Frequently asked questions
- What does "Exposed environment file (.env)" mean?
- This file is being served to anyone who requests it, and it holds the credentials your application runs on — database URLs, API keys, and signing secrets.
- How serious is it?
- ShipReady rates this critical. Fix before launch. On its own, this is enough to compromise the application.
- How do I fix it?
- Paste the fix prompt on this page into Cursor, Claude Code or your AI editor. It is the same prompt ShipReady puts in your report.
- Can I check my own site?
- Yes — ShipReady scans up to ten pages of any public site for free and reports this alongside every other check.
Related checks
Does your site have this?
ShipReady checks this and 73 other things across up to ten pages of your site. Free, no signup.
Scan my site