Lovable: files you deployed by accident
Bots request /.env on every new domain within hours of it going live. Here is how to find out what yours answers with.
This category is unglamorous and disproportionately damaging. Nobody chooses to publish their environment file; it happens because a file sat in the wrong folder and the whole folder got deployed.
What tends to leak from a Lovable project
- Source maps (.js.map) — these turn your minified bundle back into original, commented source. Your logic, route names and auth flow become readable.
- Environment files (.env, .env.local, .env.production) — if one lands in the public folder it is served like any other file.
- Backups and dumps (backup.sql, db.sql) — a full copy of your data, downloadable.
- Editor and OS leftovers (.DS_Store) — lists the filenames in a folder, defeating any security-by-obscure-filename.
Check it yourself, two minutes
Ask your own site for the files it should not have
- 1Open each of these URLs in a browser, replacing the domain with yours.
- 2yourapp.com/.env — should be a 404, never a page of KEY=value lines.
- 3yourapp.com/.git/HEAD — should be a 404. If it returns 'ref: refs/heads/main', your whole repository history is downloadable.
- 4yourapp.com/backup.sql and /db.sql — should be 404.
- 5In DevTools → Sources, look for files ending .map. If you can open one and read your original code, source maps are deployed.
Or check them all at once
for p in .env .env.local .git/HEAD backup.sql .DS_Store; do
printf "%-14s " "$p"
curl -s -o /dev/null -w "%{http_code}\n" "https://YOURAPP.com/$p"
doneEvery line should print 404. A 200 means that file is public.
Paste this into Lovable
Audit what my deployment actually serves and remove what should not be there. 1. Check whether any of these are reachable in production and fix each: .env, .env.local, .env.production, .git/, backup.sql, .DS_Store, any *.map source map file. 2. Ensure environment files live outside the public/static directory and appear in .gitignore and .dockerignore. 3. Disable production source maps in the build config. 4. Add a rule that returns 404 for any path starting with a dot. Then tell me which of these were actually exposed before the change. For each one that was, list the credentials it contained so I can rotate them — assume anything that was public has already been collected.
This is one check out of 40+
Paste your site address and we run the whole list from the outside — leaked keys, open databases, unprotected pages — then hand you one prompt that fixes what we find. Free, about 30 seconds, no signup.
Check my site — free