On 2026-07-30, it was discovered that three environment files containing secrets were committed to the repository:
apps/web/.env.developmentapps/web/.env.productionapps/web/.env.staging
These files contained the following secrets that must be treated as compromised:
DATABASE_URL- Database credentials (user:password@host:port/db)PINATA_JWT- JWT token for Pinata IPFS serviceRESEND_API_KEY- API key for Resend email service
- ✅ Audited all three files and classified variables as public vs secret
- ✅ Updated
.gitignoreto prevent future .env file commits - ✅ Untracked the three files from git using
git rm --cached - ✅ Added Gitleaks CI check to prevent future secret commits
- ⏳ Secret rotation (requires manual action by maintainers)
Pros:
- Removes secrets from public git history
- Prevents future accidental exposure through git history browsing
- Cleaner repository state
Cons:
- Breaks all existing clones - contributors must re-clone
- Breaks pull requests - if any PRs reference the old commits
- Breaks deployments - if any deployment systems reference specific commit SHAs
- Complex rollback process - if something goes wrong
- False sense of security - secrets may already be:
- Cached by GitHub's internal systems
- Downloaded by forks and clones
- Exposed in GitHub's API logs
- Backed up by GitHub's disaster recovery systems
Pros:
- No disruption to existing contributors or deployment workflows
- Maintains git history integrity
- Recognizes that the damage is already done - secrets are already exposed
- Focuses on actual remediation (rotation) rather than cosmetic cleanup
Cons:
- Secrets remain in git history (readable by anyone with repository access)
- Requires ongoing vigilance about the exposure
Do NOT rewrite git history.
The security damage is already done - the secrets have been exposed to:
- Anyone with repository access (including forks)
- GitHub's internal systems and caches
- Anyone who cloned the repository before this fix
History rewriting provides a false sense of security while causing significant operational disruption. The effective remediation is:
-
Immediate secret rotation (P0):
- Rotate all database credentials in
DATABASE_URL - Rotate all Pinata JWT tokens in
PINATA_JWT - Rotate all Resend API keys in
RESEND_API_KEY
- Rotate all database credentials in
-
Move secrets to secure storage:
- Configure Vercel environment variables for production/staging
- Use local
.envfiles for development (already in.gitignore) - Ensure secrets are never committed again
-
Prevent future occurrences:
- ✅ Updated
.gitignore - ✅ Added Gitleaks CI check
- Consider adding pre-commit hooks for secret detection
- ✅ Updated
-
Rotate database credentials immediately:
- Change database passwords for all three environments
- Update deployment platform secrets (Vercel environment variables)
- Update local development
.envfiles (not committed)
-
Rotate Pinata JWT tokens:
- Generate new JWT tokens in Pinata dashboard
- Update deployment platform secrets
- Update local development
.envfiles
-
Rotate Resend API keys:
- Generate new API keys in Resend dashboard
- Update deployment platform secrets
- Update local development
.envfiles
-
Verify no other secrets exist:
- Run
gitleaks detectlocally on the repository - Review commit history for other potential secrets
- Audit GitHub deploy keys and tokens
- Run
- Immediate (P0): Rotate all secrets mentioned above
- Within 24 hours: Verify no other secrets exist in repository
- Ongoing: Monitor Gitleaks CI check results
- GitHub Security Advisory: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
- Gitleaks Documentation: https://github.com/gitleaks/gitleaks
- OWASP Secret Management: https://owasp.org/www-community/Secrets_Management_Cheat_Sheet