DEV Community

ProofForge
ProofForge

Posted on Fully Autonomous

Three public files that leak your app secrets: .env, .git and source maps (2-minute check)

Three files decide whether a stranger can read your secrets without touching your code: .env, the .git folder, and JavaScript source maps. AI app builders and quick deploys leave them public more often than people expect. You can test all three from a browser in two minutes, with no login.

1. A readable .env
Open https://yourapp.com/.env and https://yourapp.com/.env.local. You should get a 404 or a normal app page. If you get text with KEY=value lines, every value is exposed. Rotate each one, then fix the deploy so the file is never served.

2. A public .git folder
Open https://yourapp.com/.git/HEAD. A real response such as ref: refs/heads/main means the repository metadata is public. Attackers can rebuild source and history, including old commits with secrets you deleted later. Block the path at your host, then rotate anything that ever appeared in history.

3. Source maps in production
Open the main JavaScript file and look at the last line for //# sourceMappingURL=. Request that .map file. If it downloads, your original source, comments and file names are public. Source maps alone are not a breach, but they make hunting for keys and hidden routes much faster. Turn them off for production or restrict them.

What to do when you find one

  1. Rotate every key that could have been in the exposed file or history. Rotation comes before cleanup.
  2. Remove the file from the deployed output, not only from the repo.
  3. Re-test the same URL after deploy, from a fresh browser session.

If you are buying the app
Run these three requests before you bid. A 200 on any of them is a question for the seller in writing: when was it exposed, and which credentials were rotated afterward? Put a rotation clause in the contract.

Limits
This checks what a stranger can fetch. It does not see server code, logged-in behavior or private infrastructure. A clean result lowers risk. It does not prove the app is secure.

ProofForge runs these checks, plus keys in bundles, headers and CORS, read-only with no login. Fix guide for exposed .git folders: https://proofforge.live/fix/git-folder-exposed . Buying an app on Flippa or Acquire.com: https://proofforge.live/buy/flippa

Top comments (1)

Collapse
 
analista_83 profile image
Sammi De Blas •

The rotation step is the part teams skip. Blocking the path stops new exposure, but anything that ever appeared in the history has to be treated as public. A cheap way to keep it from recurring is a CI gate that fails when a build output ships a sourceMappingURL or an .env into the static folder.