Allsafe Android Pentesting — Part 4: Firebase Database Inse
The Android app stored its Firebase database URL in a resource string, and the database's security rules allowed public read access. Anyone with the URL could append .json and retrieve the entire database contents without authentication.
In the previous part, we learned how developers often leave sensitive secrets inside the APK. Today, we are taking that a step further by showing how a single hardcoded URL can lead to a massive cloud data breach.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Firebase Realtime Database security rules were configured with public read access (and possibly write access) instead of restricting access to authenticated users.
Impact
Anyone with the database URL could read the entire database contents without authentication; if write permissions were also open, an attacker could delete or inject data.
What the attacker needed
The app's APK; the Firebase database URL; a web browser
The fix
The Firebase security rules should be changed to only allow authenticated users to read and write their own data, as shown in the secure rule example.
How it was found
- Open the APK in JADX-GUI and navigate to the resources.arsc strings.xml file.
- Search for the keyword 'firebase' to find the database URL string.
- Copy the Firebase database URL and append '.json' to it.
- Paste the resulting URL into a web browser to view the database contents.
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 write-up has not been written yet. The Original tab links to the source.
Firebase is a cloud database service that apps often use to store data. The app's security settings decide who can read or write that data. Here, the settings were left open so that anyone on the internet could read everything just by knowing the database's web address, which was hidden inside the app itself.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.