Firebase Firestore insecure database
The Android app exposed a Firebase project name that allowed unauthenticated access to a Firestore database. An attacker could use the Firestore REST API to add documents to the database.
- Disclosed after 3 months
Summary:
The app is exposing a firebase database url that has no read/write protections.
Steps To Reproduce:
- Decompile the Android app
- Do a string search for
firebase_database - Use the project name (i.e.
msdict-dev) in combination with the Firestore REST API to modify the database.
Supporting Material/References:
Via decompilation an attacker can get the project name for a Firebase database. Then they can use the Firestore REST API to modify the DB. I was able to add a new document to the DB with the following script.
curl https://firestore.googleapis.com/v1/projects/msdict-dev/databases/%28default%29/documents/test -H 'Content-Type: application/json' -d '{ "fields": { "title": { "stringValue": "TEST" }} }'
to view the document that was added just visit:
https://firestore.googleapis.com/v1/projects/msdict-dev/databases/%28default%29/documents/test
Impact
An attacker has access to an insecure database.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could add documents to the database.
What the attacker needed
Android app available for download; No authentication required
How it was found
- Decompile the Android app
- Search the decompiled code for the string firebase_database
- Use the discovered project name with the Firestore REST API to modify the database
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Firebase is a cloud database service. If its security rules are left open, anyone who knows the project name can read or write data without logging in. Here, the project name was hidden inside the Android app, so an attacker could extract it and then use a public web API to add records.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.