Terms & acceptable use
⚡ Free live-app check

Paste your live link (like my-app.web.app, my-app.vercel.app, my-app.replit.app or your own domain). We check it from the outside for leaked secret keys, open data and more. Free.

FreeJust your email to see results10 seconds

The free scan shows your problems. The $9 fix report gives you a copy‑paste fix prompt for each one.

Guide · Firebase · Firestore · Realtime Database · Storage · Updated

Is My Firebase App Secure? A Free Firebase Security Rules Check for Vibe-Coded Apps

Lots of apps built with Cursor, Replit and other AI tools use Firebase for login and data. Your app talks to Firebase right from the browser. That is normal. It also means anyone can open dev tools, copy your Firebase config, and send requests to your database. What stops them is not a hidden key. It is your Security Rules. Here is how to check them on your live app, in plain steps.

1. The short answer

Firebase says the API keys in your web config are public by design. They only tell Firebase which project you mean. Who can read or change your data is decided by Firebase Security Rules for Cloud Firestore, Realtime Database and Cloud Storage. App Check helps block traffic that isn't from your real app.

Firebase also says that once your app is deployed, it is on the internet, even if you haven't launched it. If your rules are open, anyone who finds your project ID can read, change or delete your data.

So the real question is not "is my key hidden?" It is "what do my rules allow a stranger to do?"

Sources: Firebase: API keys · Firebase: Avoid insecure rules · Firebase: Rules basics

2. Find your Firebase config on your live site

Open your live app in Chrome. Right-click, pick Inspect, then press Ctrl+Shift+F (Cmd+Option+F on a Mac) to search all loaded files. Search for projectId or firebaseapp.com. You should find something like this:

apiKey: "AIza...",
authDomain: "my-app.firebaseapp.com",
projectId: "my-app",
storageBucket: "my-app.firebasestorage.app",
databaseURL: "https://my-app-default-rtdb.firebaseio.com"

This is fine to have in your site. Write down the projectId and, if you use Realtime Database, the databaseURL. You will need them for the test below.

While you are in dev tools, search for private_key and service_account too. Those come from a Firebase admin key file, and that file must never be in your frontend. See step 7.

3. Read your rules: 5 red flags

In the Firebase console, open your project. Go to Firestore, Realtime Database or Storage, and click the Rules tab. The console always shows the rules that are live right now. Look for these:

  1. Allow everyone. allow read, write: if true; in Firestore, ".read": true and ".write": true in Realtime Database, or allow read, write; in Storage. Firebase's docs say never to use these in production, because anyone can overwrite your whole database (or, for Storage, all your files).
  2. The test-mode date. A rule like allow read, write: if request.time < timestamp.date(2026, 11, 21); means anyone can read and write everything until that date. Firebase says test mode "allows anyone to read and overwrite your data." The starter test-mode rules from Firebase's own tools set the date about 30 days out. After it passes, your app's requests are denied, so the app may suddenly break.
  3. "Logged in" is the only check. if request.auth != null on private data means any signed-in user can read and change all of it. If anyone can sign up, that is almost the same as open. Firebase lists this as a common mistake.
  4. A catch-all match. match /{document=**} covers every document in the database. If it has a loose rule, it opens everything, no matter how careful your other rules are.
  5. Realtime Database parent rules. These rules cascade. If a parent path allows reading, a child path cannot take it away. A ".read": false lower down is ignored.

One more trap: if you edit rules in the console but your project also has a firestore.rules file, the next firebase deploy overwrites the console version. Firebase says to always edit rules the same way. Keep one source of truth.

Sources: Firebase: Avoid insecure rules · Firebase: Manage databases (test mode) · Firebase CLI: starter Firestore rules · Firebase: Get started with Firestore rules

4. The logged-out test

Reading rules is good. Testing them like a stranger is better. Only do this on a project you own.

Firestore. Firebase's docs say that for requests with no login, Firestore uses your Security Rules to decide. So try to read one document from a collection, with no login. Use your projectId, your public apiKey and a real collection name, like users or orders:

curl "https://firestore.googleapis.com/v1/projects/YOUR_PROJECT_ID/databases/(default)/documents/COLLECTION?pageSize=1&key=YOUR_API_KEY"
  • A document with real data comes back: anyone can read that collection. If it is private, fix your rules now.
  • A 403 PERMISSION_DENIED error: your rules blocked a logged-out visitor. Good.
  • An empty result {}: not proof either way. The collection might just be empty.

If you turned on App Check enforcement for Firestore, this request may be turned away by App Check before your rules are even checked. That is good, but it does not prove your rules are safe, so still do step 3.

Repeat for each collection. If your app uses a database other than the default one, put its ID in place of (default).

Realtime Database. Firebase says anything your rules let anyone read can be read through the REST API with no login. Add .json to your databaseURL. shallow=true lists only the top-level keys, not all your data:

curl "https://YOUR-DATABASE-URL/.json?shallow=true"

If you see a list of keys, your whole database can be read by anyone. If you see Permission denied, the top level is locked. Try your main paths too, like /users.json?shallow=true.

Storage. Open a file link from your app in a private window. Then check your Storage rules for allow read; or allow read, write; on {allPaths=**}. User uploads like ID photos or documents should only be readable by their owner.

Sources: Firebase: Firestore REST API · Firebase: Realtime Database REST auth

5. The two-account test and Rules Playground

The logged-out test catches rules that are open to everyone. It won't catch rules that let one user see another user's data. For that, make two test accounts. Add data as the first one. Log in as the second one and try to read or change it. If account two can see account one's data, your rules are too loose.

You can also use the Rules Playground. Open the Rules tab for Firestore, Realtime Database or Storage and click Rules Playground. Pick a read or a write, a path, and whether the fake user is logged in, then click Run. It tests the rules in the editor, so you can try a change before you publish it.

Sources: Firebase: Rules Playground · Firebase: Get started with Firestore rules

6. What safe rules look like

Firebase's own fix for open rules is "content owner only": each user can only reach their own data. A simple Firestore version, where each user has a document at users/their-user-id:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /users/{userId} {
      allow read, write: if request.auth != null && request.auth.uid == userId;
    }
  }
}

Any collection with no rule is closed by default. Add a rule for each collection your app really uses. Data that should be public, like blog posts, can be public to read but only writable by its owner. Contact forms and waitlists should let visitors create a document, not read the list.

Rule changes take up to a minute to affect new requests in Firestore, and up to 10 minutes to fully spread. Run the tests above again after that.

Sources: Firebase: Avoid insecure rules · Firebase: Get started with Firestore rules

7. Keys: which ones are fine to show

  • Your Firebase web apiKey (starts with AIza): fine to be public. Firebase says to keep it limited to Firebase APIs in the Google Cloud console (APIs & Services → Credentials). Keys Firebase makes are limited this way by default.
  • Keys for other Google APIs like Maps: use a separate key, limited to just that API. Firebase says never to allow the Gemini API on a public key. How to restrict a Maps key: Is my Google Maps API key safe?
  • A service account file or the Admin SDK: secret. Firebase's server libraries skip your Security Rules, so this key can read and change everything. Keep it on a server only. If it ever reached your frontend or a public repo, replace it. See what to do after a key leaks.
  • Other secrets like OpenAI keys or Stripe sk_ keys: never in frontend code. See how to check if your API key is exposed.

If you use email and password login, Firebase also suggests lowering the sign-in quota to match your normal traffic. That makes it harder for someone to use your public key to hammer your login.

Sources: Firebase: API keys · Firebase: Get started with Firestore rules

8. Where App Check fits

App Check helps make sure requests come from your real app, not a script. On the web it can use reCAPTCHA Enterprise. It works with Cloud Firestore, Realtime Database, Cloud Storage, callable Cloud Functions and more. Firebase's security checklist says to turn it on for every service that supports it.

It is not a replacement for rules. Firebase says App Check stops some, but not all, abuse. A real user of your app still passes App Check, so your rules must still stop them from reading other people's data.

Sources: Firebase: App Check · Firebase: Security checklist

9. Copy-paste fix prompts

Paste one into Cursor, Replit Agent or your AI builder's chat. Review the rules it writes, publish them, then run the logged-out and two-account tests again.

Firebase: lock Firestore rules to each user
Review my Cloud Firestore Security Rules (firestore.rules). Remove any rule that lets anyone read or write everything, like allow read, write: if true; or the test-mode rule with request.time < timestamp.date(...). Remove rules that only check request.auth != null for private data. Write rules per collection so each signed-in user can read and change only their own documents (for example match /users/{userId} with request.auth.uid == userId). Contact forms and waitlists should let visitors create a document but not read the list. Keep truly public data (like blog posts) read-only for visitors. Show me the full rules file and explain each rule in one plain sentence.
Firebase: lock Realtime Database and Storage rules
Review my Firebase Realtime Database rules and Cloud Storage rules. Remove ".read": true / ".write": true at the top level and any Storage rule like allow read, write; on {allPaths=**}. Make user data live under a path with the user id, and only let that user read and write it (auth.uid === $uid in Realtime Database, request.auth.uid == userId in Storage). Remember that Realtime Database rules cascade: a rule that allows access on a parent path cannot be taken back on a child path. Show me the full rules.
Firebase: keep admin keys off the frontend
Search this project for any Firebase service account file or value (a JSON file with "type": "service_account" or "private_key"), any firebase-admin import in code that runs in the browser, and any non-Firebase API key in frontend code or NEXT_PUBLIC_ / VITE_ variables. Move admin code to a server function or API route, store the service account in server-only secrets, and tell me which keys I need to replace at the provider.

Check the rest of your live app

VibeCheck checks your live app from the outside, the way a stranger would. It searches the JavaScript your homepage loads for secret keys (including private keys from service account files), checks common Supabase table names if your app uses Supabase, and checks security headers, Google basics like your title and sitemap, and broken links. It does not test your Firebase rules yet, so use the steps above for that.

It only looks. It never logs in, fills in forms or tries to break in. It does not see your code.

Pricing: the problems list is free (just add your email). A fix report with a copy-paste prompt for every problem is $9. Or get 10 fix reports for $29. No subscription.

No tool can promise your app is safe. VibeCheck catches common, costly mistakes so you can fix them first.

10. FAQ

Is my Firebase app secure?

It depends on your Security Rules, not on hiding your config. Firebase says its web API keys only identify your project. Your Firestore, Realtime Database and Storage data is protected by Firebase Security Rules (and App Check for abuse). If any rule says allow read, write: if true, ".read": true, or still has the test-mode date in it, anyone on the internet may be able to read or change your data.

Is it OK that my Firebase apiKey is in my frontend code?

Yes, for the key Firebase made for your web app. Firebase calls these keys public by design. They still should be limited to Firebase APIs in the Google Cloud console. Use a separate, restricted key for other Google APIs like Maps. Firebase says never to allow the Gemini API on a public key. Keys for other services, like OpenAI or Stripe secret keys, must never be in frontend code.

What is Firestore test mode, and is it safe?

Test mode is a starting set of rules that lets anyone read and write your data. Firebase says it allows anyone to read and overwrite your data, so it is only for getting started. The starter test-mode rules from Firebase's own tools also have a date about 30 days away. After that date, all requests from your app are denied.

My Firestore test mode is about to expire. Can I just change the date?

You can, but then your database stays open to everyone until the new date. The real fix is to replace the whole test-mode rule with rules that only let each user reach their own data. Then publish and test your app again.

Is "request.auth != null" enough?

Usually not. It only checks that someone is logged in. If anyone can sign up, anyone can read and write every document that rule covers. Firebase lists this as a common insecure rule. Check that the user owns the data too, for example request.auth.uid == userId.

Does App Check replace Security Rules?

No. App Check helps make sure requests come from your real app, which cuts down abuse. Firebase says it stops some, but not all, abuse. Security Rules decide which user can read or change which data. You need both.

Can VibeCheck test my Firebase rules?

Not yet. VibeCheck checks your live app from the outside for leaked secret keys (including private keys from service account files), Supabase tables anyone can read, security headers and more. It notes Google API keys it finds but does not test your Firebase rules. Use the logged-out test on this page for that.

More questions? See the VibeCheck FAQ. Also useful: vibe coding security checklist · Is my Cursor app secure? · Is my Replit app secure? · Is my v0 app secure? · Using Supabase instead? See the Supabase RLS check.