Exploiting Insecure Firebase Database!
An Android app contained a Firebase database URL, and the database's security rules were left open for read and write access. An attacker could read and write arbitrary data to the database.
Published on blog.securitybreached.org
A few days ago i was doing static analysis of an Android app on a bug bounty target, as normally i decompiled my targeted APK file was looking around in the app when i saw a string in string > resources.arsc that was “firebasedatabaseurl” : “https://TARGETED-DATABASE.firebaseio.com”.
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 database security rules were misconfigured to allow public read and write access.
Impact
An attacker could read and write arbitrary data to the Firebase database, potentially leading to data exposure or manipulation.
What the attacker needed
Access to the app or its decompiled code; knowledge of the database URL; database rules set to allow public read/write
How it was found
- Decompile the Android app and search for the Firebase database URL.
- Visit the database URL with .json appended to check read access.
- If read access is enabled, test write access using a script or tool.
- Run the exploit script to write data to 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 write-up has not been written yet. The Original tab links to the source.
Firebase is a database service. If its security rules are set to allow anyone to read and write, then anyone who knows the database address can access or change the data. Here, the address was found inside an Android app, and the rules were open.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.