← Blog · 22 October 2026
Is your .env file public? How to check your Lovable, Bolt or Cursor app
Check it in one minute: paste your app's address into the free Vibe-App Watchdog scan. We check from the outside, like any visitor, if files such as /.env or /.git answer like real files. We never open or save what is inside.
What is a .env file?
A .env file is a small text file with settings for your app. It often holds API keys, database links and passwords. Tools like Vite (used by many Lovable and Bolt apps) read it when they build your app.¹
It is meant to stay on your computer or your server. It should never be a page that anyone can load in a browser.
How can it end up public?
A few common ways:
- The file is copied into the folder your host serves to the web.
- A server or host is set up to serve every file in a folder, including hidden ones.
- The file is pushed to a public Git repo. Git only skips files you list in
.gitignore.²
OWASP, a well-known web security group, lists leftover and unreferenced files on a web server as something to test for, because they can leak sensitive data.³
How to check by hand
- Open a private browser window.
- Go to
https://your-app.com/.env - If you see text like
API_KEY=..., the file is public. If you get a "not found" page, that is good. - Try
https://your-app.com/.git/configtoo. A public.gitfolder can leak your code and history.
Note: some hosts send your normal home page for any address. If you see your app's home page, the file is probably not there. Our scan checks if the answer actually looks like the real file.
There is a second trap: keys in your JavaScript
Even if /.env is safe, some values from it still reach the browser. In Vite, any variable that starts with VITE_ is put into the code sent to every visitor.¹ So never put a secret key in a VITE_ variable.
Supabase says the same: the public "anon" key is fine in the browser, but the service_role or secret key must never be there, because it skips your database rules.⁴
What to do if your .env file was public
- Remove the file from the public folder, or block it in your host's settings.
- Make new keys. Assume the old ones are known. Create new keys in each service (Supabase, Stripe, OpenAI and so on) and delete the old ones.
- Add
.envto.gitignore. If it was ever pushed to a public repo, it is still in the history, so new keys are a must. - Run a scan again after the fix.
What our scan can and cannot see
The free scan is passive. It looks at security headers, common files that should not be public (like .env or .git), and patterns that look like secret keys in your public JavaScript. It cannot see your database rules (like Supabase Row Level Security) or your server code. A good score means we did not find the common problems we check for. It does not mean your app is fully safe.
👉 Run the free scan on vibeappwatchdog.com
--- Sources
- Vite – Env Variables and Modes: https://vite.dev/guide/env-and-mode
- Git – gitignore documentation: https://git-scm.com/docs/gitignore
- OWASP Web Security Testing Guide – Review Old Backup and Unreferenced Files for Sensitive Information: https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/02-Configuration_and_Deployment_Management_Testing/04-Review_Old_Backup_and_Unreferenced_Files_for_Sensitive_Information
- Supabase – Understanding API keys: https://supabase.com/docs/guides/api/api-keys