Your database master key was inside the app download
CriticalFixed
- What it means
- Fernway's Supabase service key was packed into the app that anyone can download from the App Store. That key ignores every permission rule you've set. It is meant to live on a server you control and nowhere else.
- What could have happened
- One person with the downloaded app and a free tool could have read, changed or deleted every row in your database: all 4,200 accounts, every saved meal plan, and every allergy note. It would have taken about ten minutes, and nothing in your logs would have looked unusual.
- What I did about it
- Took the key out of the app, then rotated it so the copy in every downloaded build is dead. The three things that genuinely needed it now live in a small server function the app calls, so the app itself holds no key that can bypass your rules.
- How to check it yourself
- Download your app from the store, unzip it, and search the files for service_role. There are no matches now. The exact command is in your handover notes.
- Whether anyone used it
- I checked your Supabase logs back to the app's first release. Every request using that key came from your own servers. That isn't proof nobody copied it, but there is no sign it was used.
What I sawThe key readable as plain text inside main.jsbundle in the downloaded app, starting eyJhbGciOiJIUzI1NiIs