Case study · · 4 min read
How a public database key exposed 58,000 customer documents on an online vendor
Checking whether a vendor's site was real, we found its customer database and file storage answering anonymous requests: roughly 58,000 orders, support messages and identity documents. What happened, why it keeps happening, and how to check your own storage in 5 minutes.
A consumer told us a vendor they had paid never delivered, and the document they did receive turned out to be forged. Checking whether the site was even real, we found its customer database and file storage answering anonymous requests: roughly 58,000 orders, support messages and uploaded identity documents, including driver's licences, reachable by anyone with the address. Below is what happened, why this keeps happening to apps built this way, and how to check your own storage in five minutes.
This is a first-party assessment by GravexLabs, prompted by a consumer tip. We used passive and semi-passive checks only, reported every finding to the vendor before publishing, and are publishing with their permission. The vendor and its customers are not named, and no exposed documents are reproduced here.
What we found
The site is a single-page application whose front end names a Firebase project and ships the project's public API key, as every Firebase web app must. That key is an address, not a credential. The exposure was not the key; it was that the project's Firestore database and Storage bucket were configured to allow reads from unauthenticated clients.
A single unauthenticated read of the orders collection returned a complete order: customer name, email, phone number, home address, and payment status. The Storage bucket answered an unauthenticated list request and enumerated to 52,928 objects across per-customer folders. Adding order records, support messages and sales leads, the collection totals roughly 58,000 items.
Uploaded files were served through long-lived download tokens embedded in each record, so a customer's driver's licence image opened directly in a browser with no session, name and date of birth legible. We confirmed two documents to establish the finding, did not retain any, and stopped.
Two further issues were readable anonymously: the coupon table, which held codes that discounted an order to zero, and markers left by a previous visitor, a test account and a proof-of-concept image, indicating the exposure had been found before and left unfixed.
The detail that matters
A public API key in front-end code is normal and is not the vulnerability. The vulnerability is treating "the app loads with a key" as if it meant "the data is protected." Access is decided by the project's security rules, not by possession of the key. Here the rules allowed anonymous reads, and in places allowed any authenticated user to read every record rather than only their own. Password-gated file links do not help when the records that contain those links are themselves world-readable.
Why this keeps happening
- A developer starts in Firebase's test mode, where rules allow open reads and writes, to get the app working.
- The app ships. The front end works, data loads, nothing errors.
- Because nothing breaks, nothing prompts anyone to tighten the rules before launch.
- Later rules are added for writes, but reads are left open, or scoped only to "signed in" rather than to the record's owner.
Nothing in the product surface reveals any of this. It is visible only to someone who reads the front-end code and asks the database a question directly.
Check your own storage in 5 minutes
Every check below is read-only and uses placeholders. Replace PROJECT and BUCKET with your own values, taken from your app's Firebase config.
Test whether your Firestore database answers anonymous reads. A 200 with documents means it is open; a 403 with PERMISSION_DENIED means it is locked:
curl -s "https://firestore.googleapis.com/v1/projects/PROJECT/databases/(default)/documents/orders"
Test whether your Storage bucket lists objects anonymously. A JSON object listing means it is open:
curl -s "https://firebasestorage.googleapis.com/v0/b/BUCKET/o"
Then review the rules, not just the responses. In the Firebase console, confirm that reads require request.auth != null and are scoped to the owner, for example allow read: if request.auth.uid == resource.data.ownerId, rather than a blanket allow read: if true or if request.auth != null.
Rotate any file download tokens that were issued while the bucket was open, and serve documents through short-lived signed URLs instead. The same test applies to other stacks: raw S3 or GCS buckets should return 403 to an anonymous list, and Supabase projects should have row-level security enabled on every table.
What a test would have found
None of this required an exploit. It required reading the page source, issuing a read the application had already shown how to issue, and paging the results. A single external, unauthenticated pass over the app surfaces the open collection, the open bucket and the readable coupons before any customer is affected. The recurring error is organizational, not technical: open rules survive to production because an open database looks identical to a closed one until someone asks.
Wherever the customers live, holding identity documents and home addresses carries a duty to secure them, and most jurisdictions require notifying affected people once such data has been exposed. With anonymous listing enabled for an unknown period, the safe assumption is that the data has already been copied, so the fix is containment and notification, not a restored secret.
Disclosure
GravexLabs reported these findings to the vendor before publication and is publishing with the vendor's consent. Target identity and all customer data are withheld. Our full process is on our Disclosure policy page.
Want this checked on your own product? Send us the brief.
More notes
Want this checked on your own product? Send us the brief.