Skip to content
Misconfiguration Write-up Beginner

Critical Bug Alert How I Hacked Into A Companys Database

A Firebase database URL and configuration were exposed in a JavaScript file, and the database's security rules allowed unauthenticated read and write access. An attacker could retrieve the entire chat history of every user and also write arbitrary data to the database.

whit3ros3 Follow

Published on infosecwriteups.com

First off, I want to say a big thank you for the incredible support on my first blog. I really appreciate it.

whit3ros3, on infosecwriteups.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 Realtime Database security rules were left open, allowing public read and write access, and the database URL was exposed in a client-side JavaScript file.

Impact

An attacker could read the entire chat history of all users and write arbitrary data to the database, which the company confirmed as critical.

What the attacker needed

None

How it was found

  1. Collect JavaScript file URLs from the target's domains using a command-line pipeline.
  2. Scan the collected JavaScript files for secrets using Nuclei templates.
  3. Open the exposed Firebase configuration URL found in the scan results.
  4. Append '/.json' to the Firebase database URL to attempt unauthenticated access.
  5. Use Firebase query filters via GET parameters to retrieve portions of the database.
  6. Check whether write access is also possible by attempting to write data.

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.

A website's JavaScript files can accidentally contain configuration details, such as the address of a cloud database. If that database is not protected properly, anyone who finds the address can read or change its contents without logging in. Here, the database held private chat messages and allowed anyone to read and write them.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by whit3ros3

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.