Firebase Misconfiguration in Android Apps: What Actually Matters
Firebase config values ship inside every Android app that uses it. Whether that is a problem depends almost entirely on the security rules behind them.
The key is not the secret
A google-services.json file puts the Firebase project ID, the database URL and an API key into the app. Anyone who downloads the app can read them. Firebase's own documentation says these API keys identify the project and are not meant to be secret; access to data is controlled by Firebase Security Rules and, optionally, App Check.
So a finding that only says "Firebase API key found" is a signal, not a vulnerability. The question is what that project allows.
Where the real risk is
- Realtime Database rules such as
".read": truemake the whole tree readable to anyone who knows the URL. - Cloud Firestore rules like
allow read, write: if true;, often left from test mode, do the same for documents. - Cloud Storage rules that allow public listing or writing expose uploaded files such as ID photos or documents.
- Rules that only check
request.auth != nulllet any signed-in user, including one who just created an account, read every other user's data.
These are server-side authorization failures under MASVS-AUTH and data exposure under MASVS-STORAGE, even though the fix is in the Firebase console, not the app.
How to review it safely
Only test Firebase projects that belong to the app you are authorized to assess. Review the rules directly in the console if you have access; that is faster and more complete than probing. If you are testing from the outside, use your own test accounts, read only paths the app itself uses and stop as soon as you see data that is not yours. Do not write to production data.
A good report entry includes the rule or request, the path, the account used and redacted proof of what was readable.
Fixes that hold
Write rules that match the data model: users read and write only documents they own, and shared data is checked against an explicit membership field. Use the rules simulator and emulator suite to test them before deployment. Turn on App Check to make abuse from outside the app harder, and restrict the API key in Google Cloud to the APIs and app signatures it needs.
The takeaway
Treat a Firebase key in the app as a pointer to something worth checking, not as the finding itself. Our post on triaging hardcoded API keys shows how to tell which keys matter, and why the backend is often the biggest risk explains the bigger picture.