Skip to content
Access control Write-up Intermediate

How I Turned an Anonymous Token Into Full Read Access to a Produc

An internal endpoint that issued Firebase tokens accepted anonymous JWTs without validating the anonymous claim, allowing an attacker to obtain a privileged Firebase custom token. This led to read access to production Firebase Realtime Database, including user records and internal financial data, and write access to Firebase Auth.

Amerghaith Follow

Published on medium.com

I recently found a critical authentication bypass on a private bug bounty program that let me dump 21MB of production data — user records, internal financial data, and admin credentials — starting from zero authentication. Four HTTP requests, no account needed.

Amerghaith, 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

The internal endpoint that issued Firebase tokens did not validate the anonymous claim on incoming JWTs, treating anonymous tokens as authenticated sessions.

Impact

An attacker could read sensitive production data including user records and internal financial data, and could write to Firebase Auth, with a refresh token allowing persistent access.

What the attacker needed

No account needed; access to public anonymous JWT endpoint; knowledge of internal Firebase token endpoint

The fix

The authentication check was patched and affected tokens were revoked; additionally, Firebase RTDB security rules should be tightened to limit access to specific subpaths.

How it was found

  1. Obtain an anonymous JWT from the public endpoint.
  2. Send the anonymous JWT to the internal Firebase token endpoint.
  3. Receive a Firebase custom token and API keys in the response.
  4. Exchange the custom token and API key for a Firebase ID token via Google's Identity Toolkit.
  5. Use the ID token to read the production Firebase Realtime Database.
  6. Optionally, use the token to modify Firebase Auth (e.g., change an admin email).

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 JSON Web Token (JWT) is a small piece of data a website gives you to prove who you are. Here, the site gave anonymous visitors a token marked as 'anonymous', but an internal service that hands out more powerful Firebase tokens did not check that mark. So anyone could swap the anonymous token for a powerful one and read private 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.