Test Firebase by reading the deployed rules and then hitting Firestore and Storage directly with the project config from the client bundle. A rule of allow read: if request.auth != null lets any signed-up user read every document, which is the usual finding.
Where this class of bug actually lives in a Firebase project
- Open rules.
allow read, write: if truein development, deployed once and never replaced. - Auth-only rules.
if request.auth != nullauthenticates but does not authorize: every user reads every document. - Firestore query shape. Rules are not filters. A client can query a collection broadly and receive whatever the rule allows.
- API key scope. The Firebase API key in the bundle is public by design; what matters is which APIs it is allowed to call and whether the rules back them.
What to try first
- Read the shipped config for
projectIdandapiKey, then query Firestore's REST API with it. - Sign up a throwaway account and repeat every read — most findings only appear for an authenticated user.
- Try writing to a collection the UI only reads from.
- Check Storage rules separately; they are a different file.
A reproduction you can keep
Two requests: an anonymous read, then the same read with a fresh account.
# anonymous
curl -sS 'https://firestore.googleapis.com/v1/projects/<pid>/databases/(default)/documents/invoices?pageSize=3&key=<apiKey>'
# authenticated as a brand new user
curl -sS 'https://firestore.googleapis.com/v1/projects/<pid>/databases/(default)/documents/invoices?pageSize=3' \
-H 'Authorization: Bearer <idToken>'
# vulnerable: documents from every user, especially in the second call
# fixed: PERMISSION_DENIED or an empty result for a user with no matching dataWhat "fixed" has to look like
Rules must scope on the document's owner or tenant field, not merely on authentication, so a fresh account gets PERMISSION_DENIED or an empty set. Confirm with a brand-new account, because an anonymous test passes on auth-only rules.
Where people get this wrong
- Testing anonymously is not enough. Auth-only rules look correct from an anonymous request.
- The emulator does not enforce deployed rules; test the real project with a throwaway account.
- Composite indexes and query patterns can make a correctly scoped rule unusable, which is how open rules get deployed in the first place.
What Offense does here
Offense runs an agent swarm against your app in a disposable sandbox, keeps the request, the identity and the vulnerable response as evidence, and replays the same attack after the fix so the retest is a control comparison rather than a green check. It does not read your source and it does not patch your code: the finding goes to your coding agent with the reproduction attached. The hosted workspace is invite-only — join the waitlist — and the free dependency audit in /install needs no account.
Questions this page answers
Is the Firebase API key a secret?
No, it ships in every client. Security comes from the rules, and from restricting which APIs the key may call.
Why do auth-only rules fail a security test?
Because any user who can sign up can then read every document the rule covers. Authentication is not authorization.
Written by Offense Research, reviewed December 2, 2026. Correct something? Email imran@offenseresearch.com.