Skip to content
Misconfiguration Write-up Intermediate

How I Hacked the Voting System: A Deep Dive into Firebase and Fir

The voting app's Firebase database was publicly readable and writable, and the authentication service allowed creating an account with admin-level privileges using invalid data. An attacker could read all voter data and modify vote counts.

0xmous27 Follow

Published on medium.com

The target? A voting website: https://Voting-App-voting.web.app/.

0xmous27, on medium.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 default Firebase security rules allowed open read/write access, and the authentication endpoint failed to validate account creation requests properly.

Impact

An attacker could read all voter information and modify vote counts, potentially committing election fraud and exposing personal data.

What the attacker needed

Access to the mobile app or web app; no special privileges needed

The fix

The flaw was fixed according to the author, though the specific fix is not detailed; generally, Firebase security rules should restrict access and API keys should not be hardcoded.

How it was found

  1. Extract the APK from the Google Play Store and decompile it with APKTool.
  2. Search the decompiled code for Firebase database references to find a partial database name.
  3. Use Burp Suite to capture app requests and retrieve the full database name.
  4. Review the web app's JavaScript files to find an exposed Firebase API key and project details.
  5. Test whether the Firebase database is publicly accessible in a browser.
  6. Create a new account with invalid credentials via the authentication service to obtain tokens.

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 backend service from Google that apps use to store data. The app left its database open so anyone could read or change it, and its login system let anyone create a powerful account. This meant someone could change votes and see private voter details.

What is Misconfiguration?

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

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.