Firebase security

Is Firebase secure?

Published 21 October 2026 · 6 min read

Yes — Firebase is secure, when it's configured correctly. Google runs the infrastructure, encrypts your data, and gives you a powerful system called Security Rules to control who can read and write what. The platform itself is not the weak point.

The problem is that Firebase trusts you to write those rules. And the single most common mistake — leaving your database in "test mode" — makes every record you store readable and writable by anyone on the internet. If you built your app quickly and never touched the rules, this article will help you find out whether your data is actually protected or wide open.

Why your Firebase config is public (and why that's fine)

First, clear up a myth. Your Firebase config object — the one with apiKey, projectId, and your database URL — ships inside your app's front-end code. Anyone can open their browser's developer tools and read it. This is by design and it is not a leak.

That config isn't a password. It just tells the browser which project to talk to. The thing that actually protects your data is your Security Rules, which run on Google's servers every time someone tries to read or write. Because the config is public, your rules are the only line of defence. If the rules say "allow everyone," then everyone is allowed — config in hand, no hacking required.

The "test mode" disaster

When you create a Firestore or Realtime Database, Firebase offers a quick-start option often called test mode. It drops in rules that look roughly like this:

Test mode is meant to last a few days while you build. But projects ship, deadlines hit, and these rules quietly stay in place. The result: anyone who finds your public config — or just guesses your project's database URL — can download every user record, every email address, every private note, and can also overwrite or delete your data. No login required.

How Security Rules actually work

Security Rules are a small set of conditions that Firebase checks on the server for every single request. They sit between the request and your data, and they can't be bypassed from the client. The key building blocks are:

The most important variable you'll use in a condition is request.auth. When a user signs in through Firebase Authentication, Firebase knows who they are, and request.auth.uid holds their unique ID. Your rules can use that to make sure people only touch their own data.

The auth-based patterns to use instead

Good rules start by assuming nothing is allowed, then open up access deliberately. A few patterns cover most small apps:

Rules can also validate the shape of incoming data, but for most founders the owner-check pattern above is the one that closes the big hole.

How to check your own rules right now

You don't need to be technical to do this. Take five minutes:

Is your Firebase app exposed?

Run Faultline's free surface scan on any app in seconds. (Deep data-exposure scanning is live for Base44, with more platforms rolling out.)

Run a free scan

The bottom line

Firebase is as secure as the rules you write. The platform gives you everything you need to lock data down to the right person — but it ships with the door unlocked so you can move fast during development. If you never went back and changed it, now is the time. Check the Rules tab, kill any if true, and make sure every path requires the right user. That one change is the difference between a secure app and a public database.

Related: Broken access control, explained · The no-code security checklist