Your source code is downloadable
The site is publishing its Git folder. Anyone can download the project, including a short-lived GitHub token that was sitting in .git/config.
Why it matters
A token like that can read or change private repositories until it’s revoked. Old commits often hide other secrets too: API keys, passwords, the odd .env file someone committed on a Friday.
What we noticed
Opening /.git/HEAD returned the repository. /.git/config included a GitHub token (shown here as ghp_••••). Treat that token as public.
Fix prompt for your AI agent
Paste this into Lovable, Cursor, Bolt, or your agent.
You are fixing one security issue. Do not refactor, restyle, or change anything else.
Problem
The live site is serving the .git directory. Anyone can download the repository, and .git/config contains a GitHub token. Treat that token as already public.
What to do
1. Make sure the deployed site does not contain a .git folder. It must not be in public/, the static export, or the files uploaded to the host. Add .git to any deploy ignore list.
2. Block requests whose path is /.git or starts with /.git/. Respond with 404, not 403, so the path does not confirm that git is there. Use the host this project actually deploys to:
- Vercel: a redirect or middleware matcher.
- Netlify: _redirects or a netlify.toml edge rule.
- nginx: location ~ /\.git { return 404; }
- Cloudflare: a custom rule on the URI path.
Add the one that matches this project. Do not add all of them.
3. Revoke the GitHub token. In GitHub: Settings → Developer settings → Personal access tokens. Delete the one that was in .git/config. Create a replacement only if a deploy still needs it, and store it in the host's secret manager, never in the repo.
4. Search git history for other secrets (API keys, private keys, .env files) and rotate anything you find.
5. Check the fix. https://YOUR_DOMAIN/.git/HEAD and https://YOUR_DOMAIN/.git/config must both return 404.
Done when both URLs 404 and the leaked token is revoked.