Guide · Firebase
Firebase security rules check: is your database open?
The Firebase config in your page code is meant to be public. Your security rules are what keep strangers out of your data. Here is how to see what a stranger can read, and rules that fix it.
Free instant check, no sign-up. It only reads what your app already shows to any visitor.
Why the config is public and the rules are not optional
Every Firebase web app ships its config to the browser: apiKey, projectId, databaseURL. Anyone can read it, and that is how Firebase is designed. The browser talks to Firestore or the Realtime Database directly, and the only check on each request is your security rules.
Rules that allow everything leave the database as open as a public spreadsheet: anyone can read every user's data, and often change or delete it.
The test mode trap
When you create a database in test mode, Firebase writes rules that allow everything until a date about 30 days away:
allow read, write: if request.time < timestamp.date(2026, 12, 15);
For that month the database is open to anyone. When the date passes, the app stops working, and the quick fix people (and AI tools) reach for is allow read, write: if true;, which opens it for good. The Realtime Database version of the same thing is:
{ "rules": { ".read": true, ".write": true } }
Test it the way a stranger would
Do this only on your own project. For the Realtime Database, open this address in a private window (your databaseURL is in the page code):
https://YOUR-PROJECT-default-rtdb.firebaseio.com/.json?shallow=true
If you see the names of your data instead of "Permission denied", anyone can read the database.
For Firestore, open this address with your project ID and a collection name from your code:
https://firestore.googleapis.com/v1/projects/YOUR-PROJECT-ID/databases/(default)/documents/users?pageSize=1
A document with fields means the collection is readable without a login. PERMISSION_DENIED means the rules hold.
Rules that let users see only their own data
Firestore, for a collection where each document stores the owner's ID:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /notes/{noteId} {
allow read, update, delete: if request.auth != null
&& request.auth.uid == resource.data.ownerId;
allow create: if request.auth != null
&& request.auth.uid == request.resource.data.ownerId;
}
}
}
Realtime Database, with data stored under each user's ID:
{
"rules": {
"users": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
}
}
}
Anything not allowed by a rule is refused, so you do not need rules that deny. Do not forget Cloud Storage: it has its own rules, with the same test mode trap.
Mistakes that look like protection
if request.auth != nullalone. It only asks for a login, and anyone can sign up. Every signed-in user can read everyone's data.- Checking the owner on read but not on create. Users can create documents in someone else's name.
- A role field users can write. If users can update their own profile freely, they can set
isAdmin: true. Check which fields an update may change, or keep roles where users cannot write. - Hiding data in the app instead of the rules. Not showing a screen does not stop anyone asking the database directly.
A prompt for your AI tool
Rewrite my Firebase security rules (Firestore, Realtime Database and Storage) so nothing is open to everyone: remove "if true" and test-mode date rules, let a signed-in user read and write only their own documents (owner ID equals request.auth.uid, checked on create too), and make sure users cannot change role or payment fields. Show me the rules and how to test them in the Rules Playground before deploying.
Let ShipProof test it for you
The free check finds Firebase in your live app. The full check runs after you prove the app is yours by adding one tag to your home page: it then sends the same read-only requests as above to your Realtime Database and to each Firestore collection your app's code uses, and reports which ones answer a stranger, with field names only, never your data, plus a fix prompt.
Check your Firebase app
A grade and the problems in plain language in a few seconds.