Skip to content
Access control Write-up Intermediate

Sneaking the Fence — Part 1

The Firebase project's API key was exposed in a public JavaScript file, allowing the attacker to create a new user account and verify it. The attacker then accessed Firestore and retrieved every user's PII and sensitive financial documents, and also created unauthorised installations.

medium.com

Published on medium.com

In this series I am going to share methodologies and followed by real world scenarios where i was able to break in high sensitive areas where i should not be there.

⚡️d4rk⚡️, 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 the Firebase security rules were misconfigured, allowing unauthenticated or newly created users to read and write Firestore data, and the API key was exposed in a public JavaScript file.

Impact

The attacker could read every user's PII and sensitive financial documents, and create unauthorised installations; however, the developers still needed to approve user access based on role, limiting the level of access.

What the attacker needed

Publicly accessible JavaScript file; Firebase project with weak security rules; No sign-up required for API key use

How it was found

  1. Enumerate subdomains and use httpx to find login-only pages.
  2. Fuzz the app and discover a JavaScript file indicating Firebase use.
  3. Read the Firebase init file to obtain the project API key.
  4. Call the Firebase sign-up API with the key to create a new user.
  5. Verify the email using the OTP flow and log in with the new credentials.
  6. Access Firestore objects using the session to retrieve user 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.

Firebase is a Google service that apps use to store data and manage logins. The app's public key was left in a JavaScript file, and the database rules were too open, so anyone could sign up and read all user data.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.