← Tips

OWASPA01Broken Access Control

I Clicked Post Once. My App Deleted Everything.

No hacker, no typo. This app kept every post in one database row, so a single bad save wiped the whole board. How to tell if your app works the same way.

Watch on YouTube

The mistake

My demo community board had twenty posts from five users. I clicked Post once. Now it has zero.

It wasn't a hacker. The app kept everything (every user, every post, every phone number) in one database row. Every save rewrites that whole row. So a save only has to go wrong once.

How one save wipes it

If loading fails, this app doesn't stop. It says "couldn't load, start fresh" and carries on with an empty board. One second of bad connection, then I post like anyone would, and the app saves its copy, which is just my one post, over everything.

It doesn't have to be an accident, either. To let anyone post, every signed-in user has to be allowed to write to that one row.

The fix

Check if this is you

Paste this into your AI tool:

List every database query this app makes when a page loads, and what data each one returns. Tell me if the app stores most of its data in a single row or a single JSON column, and flag any query that returns another user's private information.

And check your backups before you need them. When I made the video, Supabase's free plan had no automatic backups, and its docs told free projects to export their own data.

The fix is to give every post its own row. The full walkthrough, with the prompts to move your data and lock it down, is in the video: One Bad Save Deleted My Entire App

The app in this tip is my own demo, built with fake data and intentionally insecure.