Firebase rules left in test mode: how AI-built apps leak their whole database (proofforge.live)
Firebase databases are reachable from the browser by design. Your security rules are the only gate. Test-mode rules, which many tutorials and AI generators paste in to get started, look like this: allow read, write: i
Firebase databases are reachable from the browser by design. Your security rules are the only gate. Test-mode rules, which many tutorials and AI generators paste in to get started, look like this:
allow read, write: if true;
or in older Realtime Database projects, ".read": true, ".write": true. With those rules, anyone who finds your project ID can read and overwrite your data.
How to check your own project
- Open the Firebase console, then Firestore Database (or Realtime Database), then Rules.
- Search for
if true,".read": trueand".write": true. Also look for rules with an expiry date that has already passed or is close. - Test from outside. For Realtime Database, open
https://YOUR_PROJECT-default-rtdb.firebaseio.com/.jsonin a browser. If JSON comes back while you are logged out, the database is open. A "Permission denied" message is what you want. - Check Storage rules the same way.
Only test projects you own.
Common mistakes
- Test-mode rules left in place after launch.
- Rules that only check
request.auth != null, which lets any signed-in user read every user's data. - Admin SDK service account JSON committed to the repo or shipped in frontend code.
- Public Storage buckets holding user uploads.
Fix
Write rules that tie access to the owner, for example allow read, write: if request.auth.uid == resource.data.userId;. Use the Rules Playground in the console to test them. Keep service account keys on the server only, and rotate any that were exposed.
Check your own app from the outside, free. Run the free ProofForge scan on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: see pricing. Building with an AI agent? There is an MCP server so it can check before it deploys.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.