The repository was audited for committed secrets across the entire git history, not just the current working tree.
Clean. Every credential is read from process.env.*; no secret values are
hardcoded in the source. (The Supabase project URL appears in a couple of
files — that is a public endpoint, not a secret.)
These values were committed in the past and later removed from the working tree, but they still exist in older commits and must be treated as compromised. The actual values are intentionally not reproduced here.
| Credential | Severity | Introduced in commit | File |
|---|---|---|---|
| Razorpay LIVE key secret | Critical (financial) | 3074bf3 |
next.config.mjs |
Razorpay LIVE key id (rzp_live_…) |
High | 3074bf3 |
next.config.mjs |
Google service-account private key (instant-edudoc, SA neelpwm@instant-edudoc.iam.gserviceaccount.com) |
Critical | 3074bf3 |
next.config.mjs |
Supabase JWT — decodes to role: anon |
Low/Med | c1ada65 |
src/pages/api/dbConnection/dbConnect.js |
| Google SA client email + Spreadsheet ID | Low (identifiers) | 3074bf3 |
next.config.mjs |
Notes:
- The Razorpay credentials are live mode — they can move real money. Highest priority.
- The Supabase key is the anon key, which is designed to be used in the browser and is protected by Row Level Security (RLS). It is lower severity, but rotate it if RLS is not strictly enforced on every table.
- No Ethereum private keys, mnemonics, or
.envfiles were ever committed.
Because these secrets were already pushed to a shared remote, rewriting git history does not undo the exposure. The only reliable fix is to revoke and reissue them:
- Razorpay — Dashboard → Settings → API Keys → Regenerate the key. Update
NEXT_PUBLIC_RAZORPAY_KEY(key id) and the server-side secret in your deployment (Vercel) env vars. - Google service account (
instant-edudoc) — GCP Console → IAM & Admin → Service Accounts → delete the leaked key (and ideally the whole SA if unused), then create a fresh key. Do not commit the JSON; keep it out of the repo (now covered by.gitignore). - Google OAuth client — if the OAuth client secret was ever live, rotate it in GCP → APIs & Services → Credentials.
- NextAuth/JWT secret &
CRON_SECRET— regenerate (openssl rand -base64 32). - Supabase anon key — rotate from the Supabase dashboard if RLS coverage is not certain.
In Next.js, any NEXT_PUBLIC_* value is inlined into the client JavaScript
bundle and shipped to every visitor. Three server-only secrets were being
read through NEXT_PUBLIC_* env vars and have now been renamed to drop the
prefix (they are only used in server-side API routes, so the change is safe):
| Old (bundled to browser) | New (server-only) | Used in |
|---|---|---|
NEXT_PUBLIC_RAZORPAY_SECRET |
RAZORPAY_SECRET |
src/pages/api/payment/razorpay.js |
NEXT_PUBLIC_GOOGLE_CLIENT_SECRET |
GOOGLE_CLIENT_SECRET |
NextAuth route |
NEXT_PUBLIC_JWT_SECRET |
JWT_SECRET |
NextAuth route |
⚠️ Action required in Vercel: rename these three env vars to match, or auth and payments will break on the next deploy. See.env.examplefor the full, corrected variable list.
.gitignorehas been hardened to cover all.env*variants, private keys (*.pem,*.key,id_rsa*), and service-account JSON files.- Add automated scanning: enable GitHub secret scanning + push protection,
and/or a pre-commit hook with
gitleaks. - Never put secrets in
next.config.mjsenv: {}(it is committed and bundled). Use.env.local(gitignored) locally and the host's env-var store in production.
Rotation above is mandatory and sufficient for safety. If you additionally want the values gone from history (cosmetic once rotated, and it rewrites every commit hash — coordinate with all collaborators and expect force-pushes to break existing clones/forks/open PRs):
# Preferred: git-filter-repo (https://github.com/newren/git-filter-repo)
# Easiest is to purge the whole files that ever held secrets:
git filter-repo --path next.config.mjs --invert-paths # then re-add the clean current version
# or replace specific strings (put each leaked value in replacements.txt):
git filter-repo --replace-text replacements.txt
# Alternative: BFG
bfg --replace-text replacements.txtAfter rewriting: git push --force-with-lease all branches/tags and have every
collaborator re-clone.