Is my .env file public?

Short answer: open your live address with /.env on the end. If anything other than an error page appears, it's public, and so is every key inside it. The same goes for /.git/config and your source maps.

Why these files matter

A .env file holds the values your app needs to run: database passwords, API keys, signing secrets. A .git folder holds your whole project history, including files you deleted and keys you removed later. Source maps (.map files) turn minified JavaScript back into readable code. None of them is meant for visitors, and all of them are just files: if the web server sends files from the folder they're in, anyone who asks for them gets them.

Attackers don't guess. These paths are the same on every site, so automated tools try them on every address they find.

How they end up public

Uploading the whole project folder

Copying a project to a host by hand, or pointing the host at the project root instead of the build output, publishes everything in it, hidden files included. On many servers a name starting with a dot isn't hidden from the web at all.

Files copied into the build

Anything inside a front-end project's public folder is copied into the site as it is. A .env or a backup saved there ships with every deploy.

Source maps switched on for production

Vite's build options have production source maps off by default (build.sourcemap is false), but templates and AI-generated configs sometimes switch them on to make debugging easier, and they stay on at launch.

Backups and editor leftovers

Files like .env.bak, config.old, backup.zip or a database dump left next to the site are just as readable as the originals.

Check your site in a minute

Use your real live address (the custom domain if you have one), and try each of these in a private browser window:

  • /.env, /.env.local, /.env.production
  • /.git/config and /.git/HEAD
  • One of your script files with .map added to the end (find a script name in developer tools → Sources)
  • /backup.zip and /.env.bak

Every one should give a "not found" or "forbidden" page. Watch for one catch: many single-page apps answer every unknown address with the home page. That's fine; it's the app's own page, not your file. What you're looking for is your actual file content: lines like KEY=value, or [core] for a git config.

If a file was public

  1. Remove it from the live site and block the paths at the host or server, so a future upload can't bring it back.
  2. Replace every secret it contained. Removing the file doesn't undo the copies already taken. Create new keys and passwords, put them on the server, then revoke the old ones. For a Stripe key, follow our leaked Stripe key guide.
  3. For a public .git folder, assume the whole source code and its history were downloaded. Look through the history for keys committed at any point and replace those too. GitHub's guide to removing sensitive data says to revoke or rotate secrets first, before rewriting history.
  4. Check your logs and bills for use you don't recognise: database reads, API calls, sign-ins.
  5. Fix the cause: deploy only the build output folder, keep secrets out of public, and turn production source maps off unless you upload them privately to your error tracker.

Prevent it next time

  • Deploy from your repository with the host's build step, so only the build output is published.
  • Keep .env files in .gitignore. Next.js's docs note that its default template already does, and warn that you almost never want to commit them.
  • Re-check after every change of host, domain or build settings: that's when these files usually reappear.

What Securick checks

The free scan asks your live site for these files the way an attacker's tool would, reads only enough to confirm what came back, and masks anything secret in the report. Among its 46 tests:

  • #11 .env file public Free
  • #12 .git folder public Free
  • #13 JavaScript source maps public Free
  • #14 Backup files public Free
  • #18 Config files public Free
  • #16 Directory listing on Free
  • #17 Debug or info pages public Free
  • #116 Development build in production Free

Pro adds the less common files, like database dumps, log files and package-manager tokens:

  • #47 Database dumps public Pro
  • #48 Log files public Pro
  • #46 .npmrc with tokens public Pro

Questions

My host says dot files are hidden. Do I still need to check?

Yes. Settings differ between hosts and change when you move, add a domain or change build settings. A ten-second check of the live address is the only proof.

My site returns the home page for /.env. Is that a problem?

Usually not. Single-page apps answer unknown addresses with the app itself. It's only a problem if the response contains your file's actual content.

Are source maps a real risk?

They don't contain keys by themselves, but they show your original code, comments and sometimes values that the bundle dropped. Keep them private unless you've decided to publish your source.

Check your live app now

Paste your app's address. The free scan runs 46 tests and shows proof for everything it finds.