Are My Firebase Security Rules Leaving My Data Open?
Short answer: a Firebase API key in your app is normal. Your Security Rules are the lock. If those rules are still open, or they only check that someone is signed in, other people may be able to read, change or delete your data.
Check your live app for free
Paste your link. The free summary usually takes under a minute.
See an example report (for example.org) · a real free scan of a test site, so you can see what you get
The key is public. The rules are the lock.
Firebase's own docs say its API keys are "Public by design" They also say: "Security of your Realtime Database, Cloud Firestore, and Cloud Storage data is enforced using Firebase Security Rules, and protection of covered APIs is by Firebase App Check — not by keeping your Firebase API key secret" (Firebase: Learn about API keys).
If your setup follows their advice, Firebase says keys restricted to Firebase services "do not need to be treated as secrets, and it's safe to include them in your code or configuration files" (same page).
So the question to ask is not "is my key hidden?" It is "are my Security Rules tight enough?" For more on the key itself, see Is my Firebase API key safe to expose?.
Three rule problems to look for
Firebase's guide on insecure rules lists common mistakes. These are the ones that show up often in apps built quickly with AI tools.
Open access
A rule like this lets anyone read and write:
allow read, write: if true;On Realtime Database, the same idea looks like ".read": true and ".write": true.
Firebase warns that if you are not signing people in and you have not set proper rules, "anyone who guesses your project ID can steal, modify, or delete the data" (Firebase: Avoid insecure rules). Your project ID is in the same public config as the API key, so it does not take much guessing.
"Any signed-in user" rules
A rule can check that someone is logged in, and then stop there. Firebase says: "If one of your rules includes auth != null, confirm that you want any logged-in user to have access to the data." It marks this pattern as not recommended, because "Any logged-in user has read and write access to your entire database" (same page).
In Firestore that often looks like:
allow read, write: if request.auth.uid != null;That is not the same as "each user can only see their own data." It means every signed-in user may be able to reach everyone else's data.
Test mode left on
When you create a database or a Storage bucket, Firebase lets you "deny access to all users (Locked mode) or grant access to all users (Test mode)." Firebase says you should "properly configure your rules and secure your data before deploying your app" (same page).
Test mode is for building. If the app is live and the rules were never changed, treat that as open access and fix it.
How to check your rules
- Open the Firebase console, select your project, then open Cloud Firestore, Realtime Database or Storage. Click Rules. Firebase says "the Firebase console always shows the most recently deployed version of your Firebase Security Rules" (Firebase: Avoid insecure rules). Check all three if you use them.
- Look for
if true,".read": true,".write": true, or rules that only checkauth != null/request.auth.uid != null. - Ask: for each path, can a stranger read or change it? Can any signed-in user read or change someone else's documents or files?
A tighter pattern is to check that the signed-in user owns the record. Firebase's own examples use a check such as request.auth.uid == resource.data.author_uid (same page). Your field might be called userId or uid instead of author_uid. The idea is the same: this user, this record, not "any user."
A copy-paste prompt for your AI builder
You can paste this into Lovable, Bolt, Cursor or a similar tool:
Review my Firebase Security Rules for Cloud Firestore, Realtime Database and Cloud Storage.
1. Show me the current rules for each one I use.
2. Remove any rule that allows read or write for everyone (such as `allow read, write: if true`, or `".read": true` / `".write": true`).
3. Do not leave rules that only check that someone is signed in (such as `request.auth.uid != null` or `auth != null`) on data that should be private.
4. Require sign-in, and only let each user read and change their own data (for example `request.auth.uid == userId` or the owner field you already use).
5. Tell me how to turn on Firebase App Check.
6. Show me every change before you apply it.
Then tell me how to test the new rules in the Firebase Rules Simulator or the local emulator before I publish them.Firebase suggests testing with the Rules Simulator in the console, or with the local emulator, before you deploy changes (Firebase: Avoid insecure rules).
What the rooGBotVC scan checks
Paste your app's URL in the box at the top of this page. The scan looks at your live site the way a visitor would. If it finds a Firebase config in your public JavaScript, it raises an info finding called Firebase config found: check your Security Rules. That finding means we noticed the config. It is not a test of your rules.
To be clear about the limits:
- The scan does not log in, open your Firebase console, or read your Security Rules.
- It does not test your database or Storage. It cannot tell you whether a rule is open.
- It can flag real secret keys (such as an OpenAI key or a Stripe secret key) if they have ended up in public code.
You still need to open the Rules tab yourself, or ask your AI builder to review them.
The free summary shows what was found. The full report adds a plain-English explanation and a fix prompt you can paste into your AI builder.
Quick recap
- Your Firebase
apiKeyin public code is normal. Security Rules are what protect your data. - Open rules, or rules that only check that someone is signed in, can leave your data open.
- Check Firestore, Realtime Database and Storage in the Firebase console, then test before you publish new rules.
- Our scan can notice a Firebase config. It cannot test your rules.
Related reading
- Is my Firebase API key safe to expose?: why the key itself is meant to be public.
- Is my Supabase anon key safe to show in my app?: the same idea if your app uses Supabase instead.
- Bolt guide: other things to check on an app built with Bolt.
Related guides
rooGBotVC is an automated, read-only check of what any visitor can see. It is not a full security audit and it does not test your database. Not affiliated with Firebase, Google, Lovable, Bolt, Cursor, Replit or v0.