Check for exposed .env files, source maps and open folders
Anyone can type an address into a browser. If a file with your keys sits somewhere your server will hand out, the fast way to a bad day is a visitor guessing its name.
Check these addresses
Replace yourapp.com with your address and open each one in a private window. You want "not found" for all of them:
yourapp.com/.envandyourapp.com/.env.productionyourapp.com/.git/configyourapp.com/backup.zipandyourapp.com/database.sql- A folder address such as
yourapp.com/uploads/that shows a list of files - Your main script's address with
.mapadded at the end, such as/assets/index-abc123.js.map
Why they leak
- The project's root folder, including
.env, is used as the folder the server shows to the public. - A build step copies more files than intended into the public folder.
- Source maps are published to production, which lets anyone read your original source code.
- A folder listing is turned on by default on the host.
What to do about it
- Keep secrets on the server only. In Vite, only variables starting with
VITE_are put into the browser bundle. In Next.js it isNEXT_PUBLIC_. Never put a secret key behind those prefixes. - Serve from a dedicated public folder such as
publicordist, never the project root. - Turn off public source maps. Vite's
build.sourcemapis off by default, and Next.js'sproductionBrowserSourceMapsis off by default. Check that nothing in your config turned them on. - Disable folder listings in your host's settings.
- If a key was ever exposed, treat it as public. Rotate it. Deleting the file does not remove copies other people may have taken.
Want this checked on your app?
The free quick look and the complete check read the public files any visitor could reach, such as common config files, source maps, backup files and open folders. Secrets are masked in the report, and what is found is never kept. An uploaded project zip is read for exposed keys but never run.
We email you once when a spot opens. No spam, and you can ask us to remove you any time at support@appinvestigators.com.
Related guides
- Vibe coding security checklist: what to check before you launch
- Security headers for AI-built apps: what to add and how
- Stop showing stack traces and error details to visitors
Last updated 2026-11-24. This guide describes common problems and fixes. It is not a guarantee that any app is secure or free of bugs.