Skip to content
ShipCheck
Guides

Is your .env or .git folder public? How to check a Lovable, Bolt or Vercel app

Updated 17 November 2026

If your live app serves a .env file or a .git folder, anyone can download it. A .env often holds API keys, database passwords and webhook secrets. A public .git folder can give away your whole source history, including secrets you later deleted. This is a common accident on vibe-coded apps: a file landed in public/, or the host deployed the repository root instead of the build output.

Check your own app for this, free.

Paste your live URL. ShipCheck looks for leaked API keys in your page and JavaScript, exposed files like /.env and /.git, missing security headers, SSL certificate problems, domain expiry (custom domains only) and what Google sees without running JavaScript. You'll see your score without signing up.

See an example report

Short answer

Open https://your-app.com/.env and https://your-app.com/.git/HEAD. You want a 404, or your homepage HTML, not a list of KEY= lines or a Git ref. Single-page apps often return status 200 and the homepage for any unknown path, so look at the content, not only the status code. If a real .env or .git file is public, take it down and rotate every secret it contained. Deleting the file is not enough.

How to check

# .env (also try /.env.local and /.env.production)
curl -sI https://your-app.com/.env
curl -s https://your-app.com/.env | head

# .git
curl -sI https://your-app.com/.git/HEAD
curl -s https://your-app.com/.git/HEAD
  • Safe: a 404, a 403, or HTML that is clearly your homepage or a generic error page (often starting with <!doctype html>).
  • A public .env: a 200 whose body is plain text with lines like OPENAI_API_KEY=… or DATABASE_URL=…. That is the leak.
  • A public .git folder: /.git/HEAD returns a line such as ref: refs/heads/main or a 40-character commit hash. From there, tools can often download the rest of the repository.

If you find a value and you're not sure whether it is meant to be public, type only its first few characters into the is this key safe? tool. Nothing you type leaves your browser. For keys already in the JavaScript bundle (not only in a file), see how to check for leaked API keys.

How it usually happens

  • The file is in public/ (or the Vite static folder). Anything in that folder is copied into the build and served at the site root. An AI tool, or a copy-paste, can put .env there without it looking wrong in the editor.
  • The host deployed the repo root, not the build output. If Vercel, Netlify, Bolt or Replit is pointed at the project folder instead of dist/ or .next/, /.git/HEAD and sometimes /.env become URLs.
  • The file was committed, then "deleted" later. Taking .env out of the latest commit does not remove it from Git history. If /.git is public, that history is public too.

What to do if one is public

  1. Remove the file from public/ (or stop deploying the repository root). Add .env, .env.* and .git to .gitignore if they aren't there. Redeploy and rerun the curl checks until you only get a 404 or the homepage HTML.
  2. Treat every secret in that file, and every secret that ever appeared in the Git history, as leaked. Revoke and replace them. The order to do that in is in which keys to rotate, and in what order. Removing the file does not invalidate a key someone already copied.
  3. Check provider usage and logs for activity you don't recognise, and put a spend limit on any paid API key.

Checklist

  1. /.env, /.env.local and /.env.production are not downloadable (or they only return your homepage HTML).
  2. /.git/HEAD is not a Git ref or a commit hash.
  3. .env is not in public/, and the host publishes the build output, not the repo root.
  4. Any secret that was in a public file or in Git history has been rotated, not only deleted.

This is one item on a pre-launch pass. For the rest (keys in JavaScript, source maps, RLS), see the vibe-coded app security checklist and source maps in production.

What ShipCheck checks (and what it doesn't)

The free scan requests /.env, /.env.local, /.env.production and /.git/HEAD on your live origin. It only flags a .env file when the response is not HTML and contains at least one NAME= line; it records the variable names, not the values, and does not store the secrets. It only flags /.git when /.git/HEAD looks like a real Git ref or commit hash, not when the path returns your homepage. Public source maps are a separate check. The scan does not search Git history, does not detect Next.js versions, and does not probe Storage buckets. The Supabase table-read test needs a free account that has verified it owns the app; the anonymous scan does not query tables. Paid plans re-scan weekly on Solo ($12/mo) or daily on Builder ($29/mo), and they check once a day that your app's URL returns a status below 400 (a 15 second timeout, with an email after two failed checks). That daily check is not a substitute for this file check.

FAQ

How do I check if my .env file is public?

Request https://your-app.com/.env (and .env.local / .env.production) and read the body, not only the status code. A leak looks like plain KEY= lines. A 200 that is your homepage HTML is a single-page-app fallback, not a leak. ShipCheck's free scan does this check and ignores homepage fallbacks.

Why is /.env returning 200 on my Lovable or Bolt app if it isn't a leak?

Many single-page apps serve the homepage for any unknown path, with status 200. If the body is HTML, the .env file is not being served. If the body is KEY= lines, it is.

What happens if my .git folder is public?

Anyone who can read /.git/HEAD can often download the repository, including old commits. That can include source code, comments, and secrets that were later removed. Take the .git directory off the live host, and rotate any secret that ever appeared in the history.

If I delete the public .env file, am I safe?

No. Anyone who requested it may already have the values. Remove the file, then revoke and replace every secret it contained (and any that were in Git history if .git was also public).

Does ShipCheck check for exposed .env and .git files?

Yes. The free scan requests /.env, /.env.local, /.env.production and /.git/HEAD, and only reports a finding when the body really is a dotenv file or a Git HEAD, not a homepage fallback. It lists variable names from a .env, not the values. It does not search Git history.

Run the same checks on your app.

A free scan takes under a minute. No card, and no sign-up to see your score and the list of issues.

See an example report