Is your .env file public? Check for exposed .env and .git
A public environment file or a public .git folder hands out the keys and the source that were supposed to stay on the server. You can check your own site in a private window before anyone else does.
Check these addresses yourself
Open a private window so you are not signed in. Visit each address on your own domain:
/.env/.env.local/.env.production/.git/config/.git/HEAD
A 404, or your normal homepage, is what you want. If the browser shows the file as text, it is exposed. For a source map, open one of your site's own .js files and look for sourceMappingURL. Open that address in the same private window. A map that returns source file names is public.
If one of them answers
Remove the file from the deployed site. It should not sit in a public folder, and the host should not copy .git into the output. Then block those paths in the hosting config so a later publish cannot put them back. Rotate every key that was in the file or in the repository history. Assume the file was already downloaded.
How this happens
The usual path is a builder that commits .env, deploys the whole project folder, or turns on production source maps. The app still works. The files are just sitting at predictable addresses.
What is fine to be public
- A Supabase anon key. It is meant for the browser. Row Level Security is what keeps the rows private.
- A Stripe publishable key, the one that starts with pk_.
A Supabase service_role key, an sb_secret_ key, and a Stripe secret key (sk_ or rk_) are not fine in a file a visitor can open.
What the free scan checks
The free Plainmend scan requests those five paths on your site. It reports /.env, /.env.local, or /.env.production when the response is the file itself and contains assignment lines. It reports /.git/config and /.git/HEAD when the body looks like those git files. It does not save the file contents. It also reads the homepage and the scripts that page loads from the same host, and it follows a sourceMappingURL only when that map stays on the same host. The problem list is free. The fixes for that report are $5.